Closed Nathan-Furnal closed 3 years ago
Hi,
Can you please send a screenshot of the buffer *LanguageTool Output*
after you use languagetool-check
. I think the problem is in the java executable or the LanguageTool binary itself. I tried to reproduce the error in Manjaro, And i can't get Java to work properly and keep getting Invalid or corrupt file error
.
Sure !
Here you go :
----- LanguageTool Command:
/usr/bin/java -Dfile.encoding=UTF-8 -jar /usr/share/java/languagetool/languagetool-commandline.jar -c utf8 --json -l en-US
----- LanguageTool Text:
This text is very strange weird arf
----- LanguageTool Output:
Error: Unable to initialize main class org.languagetool.commandline.Main
Caused by: java.lang.NoClassDefFoundError: org/languagetool/Language
Thanks.
I solved the issue in my Manjaro and it works normally. It was just that the file had missing the execute flag in Linux.
Now, from what I can see in your output, as I belived, there is a problem with the LanguageTool binary it self. This error was produced in ArchLinux because the package expects you to use the standalone version from LanguageTool download page. No the class files directly (ArchLinux uses and download the package class files not the executable and creates a wrapper /usr/bin/languagetool
that invoke all the classes in the proper way)
I know now how to fix it and will implement that in a couple days. Meanwhile, I suggest you to download and use the standalone version from https://languagetool.org/download/
Thanks for the quick update =)
Right now it didn't work, I forgot some configurations, but in the next version your config should be something like:
(use-package languagetool
:ensure t
:defer t
:commands (languagetool-check
languagetool-clear-buffer
languagetool-correct-at-point
languagetool-correct-buffer
languagetool-set-language)
:config
(setq languagetool-language-tool-class t
languagetool-language-tool-jar "org.languagetool.commandline.Main"
languagetool-server-language-tool-jar "org.languagetool.server.HTTPServer"
languagetool-java-arguments '("-Dfile.encoding=UTF-8" "-cp" "/usr/share/languagetool:/usr/share/java/languagetool/*")
languagetool-default-language "en-US"
languagetool-java-bin "/usr/bin/java"))
Thanks a ton for the quick fix!
Hi,
I installed
languagetool
throughpacman
(archlinux), it works fine on its own. But when I try to use it in Emacs withlanguagetool-check
, I get the following :Using the server works when I start it from the command line but not from Emacs, I think this has to do with the paths not being the same when installing from a package manager rather than from the project's page.
How can I fix this?
Thanks
N.B : my config