question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error starting jdt language server downloaded by coc-java

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
bgx90commented, Mar 21, 2019

@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 with touch hello.java and then run nvim 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.

2reactions
rockneverdies55commented, Feb 22, 2020

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 launch nvim 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't get jdt language server to work on coc-java extensions ...
Every time I open a file with .java extension it says "Starting JDT Language server at /home/$user/" then I get an error: "JDT...
Read more >
neoclide/coc.nvim - Gitter
I would prefer to resolve coc-java problem. Last time I've tried to use java language server directly it took a lot of time...
Read more >
Error starting jdt language server downloaded by coc-java -
I 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 ......
Read more >
Language Server
Language Maintainer Repository Ada AdaCore github.com/AdaCore/ada_language_server ANTLR Ken Domino github.com/kaby76/AntlrVSIX Apache Camel Camel Tooling github.com/camel‑tooling/camel‑language‑server
Read more >
coc-java - npm Package Health Analysis | Snyk
Quick Start. Install this extension by run command: :CocInstall coc-java. If you do not have a Java Development Kit correctly set. Download and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found