coc-java: Error: The "java" server crashed 5 times in the last 3 minutes. The server will not be restarted
I have coc.nvim installed and to install this extension, I just opened the vim and ran below command:
:CocInstall coc-java
the output is:
Install finished - ✓ coc-java Installed extension coc-java@1.4.11 at /home/milad/.config/coc/extensions/node_modules/coc-java
But when I open a .java file, I first see:
[coc.nvim] JDT Language Server starting at /home/path/to/my/directory
and after some seconds I face below Error:
[coc.nvim] The "java" server crashed 5 times in the last 3 minutes. The server will not be restarted.
I’m on linux and I can write java files in Visual Studio Code normally if it helps anyway.
some Information:
$ java -version
openjdk version "10.0.2" 2018-07-17 OpenJDK Runtime Environment (build 10.0.2+13) OpenJDK 64-Bit Server VM (build 10.0.2+13, mixed mode)
$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 42
Version 57 of JDT Lang Sever works fine https://download.eclipse.org/jdtls/milestones/0.57.0/
Quick hack for those who are facing this issue Replace all directories/files in
~/.config/coc/extensions/coc-java-data/server
with directories/files from above extracted JDT lang server tar.After trying all the steps above it started successfully only after I issued
:CocCommand java.clean.workspace
command.I got the same exact error. I found that
:CocUninstall
did not actually remove the.config/coc/extensions/coc-java-data
. I ran the:CocUninstall coc-java
, then manually removed.config/coc/extensions/coc-java-data
. Once I ran:CocInstall coc-java
again, the language server started to work again. The error must be in how it is initially downloaded.Indeed, thank you - I downloaded the latest *tar.gz from your link: https://ci.eclipse.org/ls/job/jdt-ls-master/
At the time of this writing, that’s jdt-language-server-0.61.0-202009090949.tar.gz.
I overwrote all files/folders at
~/.config/coc/extensions/coc-java-data/server/
with the files and folders I extracted from said *.tar.gz file.That, and running with Java 11 (as provided/setup by SDKMAN!), I’m off to the races with a working coc-java install. Tested it with an existing package, and it’s certainly faster than the “0.9” version.
That worked for me too (I’m on archlinux with neovim and openjdk 1.8). Thanks.
I just did
:CocCommand java.updateLanguageServer
(from coc-java#setting-the-jdk), waited, and restarted Vim. Ubuntu 20.04 && Vim 8.2I suspect your problems lie with
java.jdt.ls.vmargs
parameter Check here: https://github.com/eclipse/eclipse.jdt.ls/issues/824#issuecomment-741857420 For default parameters. Install coc-json (or jsonc, not sure), to get autocomplete in :CocConfig for next time. I think you may have removed important default parameters instead of adding your lombok parameter to it.Besides, can you try renaming the folder I told you, and try to download the Java language server from within vim (:CocCommand java.updateLanguageServer)? Delete the old folder if it now works.
Before doing all that you can also use java.trace.server=true or something like that (see readme troubleshooting of this repo and cox.nvim repo) and then, open the server log with the corresponding coc Java command, to look for an error, then paste it here. Would be nice also if you could tell us the version of the language server you’re running.
Thank you man, worked! Ubuntu with Vim 8.2 and openjdk 1.8
it was because this one
java.jdt.ls.vmargs
I’m using AdoptOpenJDK build 1.8.0_265-b01, it only work with 0.57 version.
Actually, the latest eclipse jdt lsp is NOT 0.9 but currently 0.61.0. That’s the one I use now and it works perfectly fine, as long as you run it with Java 11. Sorry for the mess. You can see that here: https://download.eclipse.org/jdtls/snapshots/?d the date for release 0.9 is in 2017. The “jdt-language-server-latest.tar.gz” package is 0.61.0 according to “latest.txt”, and the corresponding date is in 2020. Also you can see that Eclipse CI latest build is 0.61.0 from master here: https://ci.eclipse.org/ls/job/jdt-ls-master/ @adworacz @hellowluan @mapperr you should probably migrate or I suspect you will experience lower capabilities.
I don’t know what’s the matter with these 0.7/0.8/0.9 versions, maybe they tried some advanced features and finally gave them up. You can search in Eclipse CI if you want, and in their Github repo, it’s all public.