FS#44072 - [languagetool] Exception class not found when starting the app

Attached to Project: Community Packages
Opened by William Gathoye (wget) - Friday, 06 March 2015, 14:18 GMT
Last edited by Andrzej Giniewicz (Giniu) - Monday, 17 July 2017, 22:31 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Andrzej Giniewicz (Giniu)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: I got the following exception, when I try to launch languagetool. I tried on 2 ArchLinux systems and could reproduce the issue. I downloaded the languagetool.zip from the official website and extracted it to /usr/share/java/languagetool which solved the problem. It seems thus this is an ArchLinux specific problem. Now languagetool is working again, TexStudio could use it properly.

Additional info:
[user@localhost ~]$ java -jar /usr/share/java/languagetool/languagetool.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/languagetool/language/RuleFilenameException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
at java.lang.Class.getMethod0(Class.java:2856)
at java.lang.Class.getMethod(Class.java:1668)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.languagetool.language.RuleFilenameException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more

Steps to reproduce: java -jar /usr/share/java/languagetool/languagetool.jar
This task depends upon

Closed by  Andrzej Giniewicz (Giniu)
Monday, 17 July 2017, 22:31 GMT
Reason for closing:  Works for me
Additional comments about closing:  I tested and it works.
Comment by Andrzej Giniewicz (Giniu) - Friday, 06 March 2015, 20:01 GMT
languagetool was packaged to match Arch Linux package guidelines: https://wiki.archlinux.org/index.php/Java_package_guidelines

If you start it using provided command, everything works. Two solutions should work:

1) start languagetool as a server using provided command (languagetool) and TeXStudio should be able to use it.

2) configure TeXStudio to use languagetool command. I believe setting "java" executable to "languagetool" and leaving jar empty should do the trick.

Anyway, I will look into it to see if we can make it work with TeXStuio and our directory layout.
Comment by William Gathoye (wget) - Saturday, 07 March 2015, 17:04 GMT
Ok. I understand better the problem now. I wrote a comment on TeXstudio forums about a possible future feature requesting to have, in the future, a way in the TeXstudio GUI to specify a shell script directly without using that ugly trick which fakes our java executable to be languagetool. https://sourceforge.net/p/texstudio/discussion/907839/thread/99725cc8/
Comment by Andrzej Giniewicz (Giniu) - Tuesday, 31 March 2015, 09:14 GMT
I think I've found the solution to your problem thanks to the post from thread you linked to. Try specifying:

/usr/share/java/languagetool/*.jar

as your classpath. It should do the trick.
Comment by Andrzej Giniewicz (Giniu) - Tuesday, 31 March 2015, 09:19 GMT
I'm closing this as 'wont-fix' for now. Reopen if you have any further issues.
Comment by Sinan Birbalta (SinBirb) - Sunday, 25 June 2017, 15:09 GMT
  • Field changed: Percent Complete (100% → 0%)
The workaround for Texstudio is not working for me when specifying /usr/share/java/languagetool/*.jar or the expanded string with all paths as LT path. Instead when I download the languagetool desktop package from their website and use the jar file, it works.
Comment by Andrzej Giniewicz (Giniu) - Monday, 17 July 2017, 22:31 GMT
You can also specify following data into configuration:

java: languagetool
path: .
options: --http -p 8081

it should work that way (you will use same wrapper as command line version and GUI version).

Loading...