Back to LanguageTool Homepage - Privacy - Imprint

Error: Could not find or load main class


I have same requirement as


How to add a new dictionary

but it is related to car.
As mentioned in that post, add words to

Now If I execute below line , reference Link
java -cp languagetool.jar en_US -i en-US-GB -info file -o Englist_output.dict

Getting error
Error: Could not find or load main class

You can use the following script for English:

or use command
java -cp languagetool.jar -i en_GB.txt -info -o Englist_output.dict

Building a spell checker dictionary

Hi @Yakov ,
I have tried this command but still same error-

Please let me know I am using correct path to run this? Or there is any other way to do this.(FYI I am using Windows)

No, the path is wrong.
The command must be run from the directory with languagetool.jar

1 Like

I searched for the directory with languagetool.jar, But didn’t find it in this project
Steps followed-

  1. Cloned the languagetool project.
  2. Build this.
  3. Run command

java -cp languagetool.jar -i en_GB.txt -info -o Englist_output.dict

Please let me know is this the correct step or did I miss something? I tried to find the languagetool.jar in the project where I add language-all as maven dependency but couldn’t find it.

The file languagetool.jar needs other folders. If you move the file, you need to move all the folders.
From the LanguageTool parent directory, you should run:
java -cp ./languagetool-standalone/target/LanguageTool-5.7-SNAPSHOT/LanguageTool-5.7-SNAPSHOT/languagetool.jar ......

1 Like