Error starting jdt language server downloaded by coc-java
See original GitHub issueI am using nvim v0.3.4. I have installed coc.nvim using nvim’s builtin package manager and running :call coc#util#install()
in nvim and the installation completed successfully. Yarn was installed automatically during the installation, so I opened nvim in a new terminal to install coc-java. When I ran :CocInstall coc-java
. The installation stopped without installing coc-java and gave a message complaining that yarn was already installed and that I should remove it (I don’t think that should have happened). I removed yarn and reran :CocInstall coc-java
which then succeeded and resulted in jdt ls being downloaded. I closed nvim and ran nvim hello.java
from the terminal to create a new java file to try out the plugin. Nvim immediatley gave me this error message:
[coc.nvim] JDT Language Server starting at /home/user/java [coc.nvim] Error output from java: Connection to server is erroring. Shutting down server. [coc.nvim] Error output from java: Connection to server is erroring. Shutting down server. [coc.nvim] Error output from java: Connection to server is erroring. Shutting down server. [vim-node-coc]: Uncaught exception: TypeError: Cannot convert object to primitive value at ChildProcess.client_1.BaseLanguageClient.createMessageTransports.serverProcess.on.code (/snapshot/coc.nvim/lib/language-client/index.js:348:39) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
I am just trying to create a single “hello world” java file; I am not creating a project of any kind. I saw that someone had this error when trying to use their own separate jdt ls installation, but I am using the server installed by coc-java. Have I missed something?
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (5 by maintainers)
Top GitHub Comments
@chemzqm I found the cause of my problem. When I tried to start nvim from the command line with
nvim hello.java
to start nvim and create a buffer for a java file or run:e hello.java
from inside nvim, the fact that only a buffer was created and not a file which seems to confuse the extension or the server which seem to only cope with files. If I create a file withtouch hello.java
and then runnvim hello.java
from the terminal or:e hello.java
after starting nvim, the extension works. So, the issue I was seeing was caused by the fact that the extension/server is working with files only and not vim buffers. Thanks for your help.None of the above worked for me. What I did was to forcefully remove the content of coc-java folder.
So
rm -rf ~/.config/coc/extensions/coc-java-data/*
then launchnvim
in my project root dir and open an arbitrary java file from the project. First coc.nvim displayed jdt.ls not found it’s being downloaded message followed by starting java language server message and finally it started.