Java.lang.NoClassDefFoundError: net/sourceforge/segment/srx/SrxParser

I tried using LanguageTool in command-line mode, as described in the documentation.
It seems a necessary file is not included in the .jar file.

$ java -jar LanguageTool.jar stories/40/chapter.1.txt
No language specified, using English
Exception in thread “main” java.lang.NoClassDefFoundError: net/sourceforge/segment/srx/SrxParser
at org.languagetool.language.English.getSentenceTokenizer(English.java:53)
at org.languagetool.Main.main(Main.java:481)
Caused by: java.lang.ClassNotFoundException: net.sourceforge.segment.srx.SrxParser
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 2 more

On Samstag, 12. Mai 2012, you wrote:

I tried using LanguageTool in command-line mode, as described in the
documentation. It seems a necessary file is not included in the .jar file.

That’s strange - could you post the output of “java -version”? Also, is
there a file segment-1.3.0.jar in the directory that also contains
LanguageTool.jar?

Regards
Daniel


http://www.danielnaber.de

The problem was that I copied the LanguageTool.jar file to a different directory and tried to use that copy. It works if I use the copy in the original unzipped directory.