mhayashi1120 / Emacs-langtool

LanguageTool for Emacs
GNU General Public License v3.0
377 stars 31 forks source link

java.lang.NoClassDefFoundError: org/languagetool/JLanguageTool #8

Closed bricewge closed 10 years ago

bricewge commented 10 years ago

Hello,

This is my setup with languagetool 2.5:

java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.6) (ArchLinux build 7.u51_2.4.6-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)
GNU Emacs 24.3.1

I configure it this way:

(require 'langtool)
(setq langtool-language-tool-jar "/usr/share/java/languagetool/languagetool-commandline.jar")
(setq langtool-java-bin "/usr/bin/java")
;; Set keybindings
(global-set-key "\C-x4w" 'langtool-check)
(global-set-key "\C-x4W" 'langtool-check-done)
(global-set-key "\C-x4l" 'langtool-switch-default-language)
(global-set-key "\C-x44" 'langtool-show-message-at-point)
(global-set-key "\C-x4c" 'langtool-correct-buffer)

(setq langtool-mother-tongue "fr")

But langtool-check always return me the following:

LanguageTool exited abnormally with code 1 (Exception in thread "main" java.lang.NoClassDefFoundError: org/languagetool/JLanguageTool)
mhayashi1120 commented 10 years ago

Thanks for the report.

This is my setup with languagetool 2.5:

Hmm, version 2.5 is working for me.

(setq langtool-language-tool-jar "/usr/share/java/languagetool/languagetool-commandline.jar")

It seems under package system file. Please download and try original zip file from https://www.languagetool.org/

mhayashi1120 commented 10 years ago

And please look into environment variables.

bricewge commented 10 years ago

When used with the original zip file, langtool for emacs is working, thanks. Do you know how to use it with the package from a package manager?

mhayashi1120 commented 10 years ago

@bricewge I don't enough know about ArchLinux package system and Java. Please try:

diff -r /path/to/LanguageTool-2.5 /usr/share/java/languagetool/

This may help to disclose the difference between zip and Arch package system.

bricewge commented 10 years ago

From the diff I get this: http://hastebin.com/xowirigide.avrasm. And the package has been built with this recipe https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/languagetool. It looks like the .jar and the libs directory had moved to /usr/share/java instead of all the files being in the same directory.

mhayashi1120 commented 10 years ago

@bricewge Is this Arch package working?

For instance, languagetool-commandline.jar is just a zip file, this contains:

 META-INF/MANIFEST.MF

This file seems to say this jar file need to keep directory structure. I think that you need to bug report to archlinux project.

bricewge commented 10 years ago

:+1: Thanks a lot @mhayashi1120, you nailed it! I filed a bug here: https://bugs.archlinux.org/task/39925

bricewge commented 9 years ago

If someone else get the same issue on Archlinux, you should use the emacs-langtool AUR package instead of the languagetool package.