coc-java icon indicating copy to clipboard operation
coc-java copied to clipboard

Error jdt starting loader in coc

Open L1szt opened this issue 3 years ago • 6 comments

I downloaded coc-java and also considered the other thread about this problem (https://github.com/neoclide/coc-java/issues/12) and tried everything, but I'm getting the loading animation "jdt starting" all the time and can't figure out how to solve this issue. In relation to that, also the error "The "java" server crashed 5 times in the last 3 minutes. The server will not be restarted" occurs.

L1szt avatar Mar 05 '21 17:03 L1szt

I had the same problem, I think the fact that I was still using Java 8 caused the issue. The logfile under .config/coc/extensions/coc-java-data/server/config_linux/ contained lines like: Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=11))". To fix it I just set the java home to a Java 11 installation:

  1. Open the config file with :CocConfig
  2. Set java.home by adding this line: "java.home": "[PATH TO JAVA 11]". On ubuntu it is "java.home": "/usr/lib/jvm/java-11-openjdk-amd64/"

koko-ng avatar Mar 09 '21 15:03 koko-ng

I'm having the same issue, but I need to use Java 8.

Is it not possible to use Java 8 with this project?

EDIT: I can confirm the approach in this issue works for 8: https://github.com/neoclide/coc-java/issues/99

manually download the jdt files and plop them in the extension folder (details provided by others in the above issue)

vcavallo avatar Mar 09 '21 16:03 vcavallo

@vcavallo I think it is possible to use different versions for the project and the language server, maybe Setting the JDK could help?

koko-ng avatar Mar 09 '21 17:03 koko-ng

@koko-ng thanks, yep, i've set the JDK as well. all the Java 8 stuff is working alright (I think), but the additional referredLibraries I'm trying to add don't seem to be picked up: #146

vcavallo avatar Mar 09 '21 17:03 vcavallo

Me too, I use JDK 11.0.12 in windows, I can't work out it. I try to use jdt.ls 0.59 but it's nothing.

Fatpandac avatar Sep 14 '21 11:09 Fatpandac

Me too, I use JDK 11.0.12 in windows, I can't work out it. I try to use jdt.ls 0.59 but it's nothing.

It’s fine when I change my user file in English.

Fatpandac avatar Sep 20 '21 05:09 Fatpandac

Should be fixed on recent version of coc-java, try upgrade coc.nvim to latest release and coc-java to version 1.14.0.

From 1.14.0, coc-java uses bundled jdt.ls and check the java version as expected.

chemzqm avatar Jan 29 '23 09:01 chemzqm