Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError #22

Open
AdrienLemaire opened this issue Sep 11, 2020 · 5 comments
Open

NoClassDefFoundError #22

AdrienLemaire opened this issue Sep 11, 2020 · 5 comments

Comments

@AdrienLemaire
Copy link

Hi and thanks for making this plugin. I'm really interested by it covering Japanese (although vim spellcheck doesn't).

I installed languagetool on arch linux, and added the vim config:

$ yay -Ql languagetool | rg commandline.jar
languagetool /usr/share/java/languagetool/languagetool-commandline.jar
" vimrc
Plug 'dpelle/vim-LanguageTool'  " grammar checker supporting japanese
let g:languagetool_jar='/usr/share/java/languagetool/languagetool-commandline.jar'
set spelllang=en_us
"set spelllang=ja

"Customize colors in colorscheme
hi LanguageToolGrammarError  guisp=blue gui=undercurl guifg=NONE guibg=NONE ctermfg=white ctermbg=blue term=underline cterm=none
hi LanguageToolSpellingError guisp=red  gui=undercurl guifg=NONE guibg=NONE ctermfg=white ctermbg=red  term=underline cterm=none

But when I try to run :LanguageToolCheck, I'm getting:

Error detected while processing function <SNR>37_LanguageToolCheck:
line   43:
Command [java -jar /usr/share/java/languagetool/languagetool-commandline.jar -c utf-8 -d WHITESPACE_RULE,EN_QUOTES -l en-US --api /tmp/nvimMCUuQC/10 2> /tmp/nvimMCUuQC/11] failed with error: 1
line   46:
['Error: Unable to initialize main class org.languagetool.commandline.Main', 'Caused by: java.lang.NoClassDefFoundError: org/languagetool/rules/Rule']

Your documentation mentions installing the latest version of languagetool, and I seem to be using the version 5

$ yay -Qii languagetool
Name            : languagetool
Version         : 5.0-1
Description     : An open source language checker
Architecture    : any
URL             : https://www.languagetool.org
Licenses        : LGPL
Groups          : None
Provides        : None
Depends On      : java-runtime-headless>=8
Optional Deps   : java-runtime: needed for the GUI version [installed]
                  libxtst: needed for the GUI version [installed]
                  gtk2: needed for the GUI version [installed]
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 290.64 MiB
Packager        : Andrzej Giniewicz <[email protected]>
Build Date      : Mon 29 Jun 2020 02:48:43 AM JST
Install Date    : Fri 11 Sep 2020 10:45:39 AM JST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature
Backup Files    :
(none)
@lf-araujo
Copy link

I am getting this too, did you find a solution?

@AdrienLemaire
Copy link
Author

unfortunately no

@mb720
Copy link

mb720 commented Mar 30, 2021

I also ran into this issue. Here I found a pointer to vim-grammarous which also integrates LanguageTool into Vim and Neovim.

Here's what I did to get it running after having installed LanguageTool on Arch with pacman -S languagetool:

Since I use vim-plug, I added Plug 'https://github.com/rhysd/vim-grammarous' to init.vim (Neovim's equivalent to vimrc) and ran PlugInstall.

If you now run :GrammarousCheck on your buffer, it will download LanguageTool's jar file and check the text for English grammar mistakes.

Since we already have LanguageTool installed system-wide, we avoid that duplication of jar files by making vim-grammarous use the existing jar file by adding let g:grammarous#languagetool_cmd = 'languagetool' to init.vim or vimrc.

I don't know if vim-grammarous can use LanguageTool's feature to detect the language of text, which is why I specified the given language with :GrammarousCheck --lang=de. This checks the text in the current buffer for German grammar mistakes.

If vim-grammarous assumes the wrong language, it will report that no grammar mistakes were found. Meaning if your faulty text is German and you run :GrammarousCheck (without specifying the language it defaults to English) it will report there are no grammar mistakes.

@shawywang
Copy link

I am getting this now and haven't got any solution.

@456Xander
Copy link

For me, it worked, if I configured the plugin to use the /usr/bin/languagetool script instead of the jar. See #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants