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

java.updateLanguageServer download the wrong eclipse.jdt.ls version

Open nicobao opened this issue 4 years ago • 2 comments

Try it locally, java.updateLanguageServer downloads ~/.config/coc/extensions/coc-java-data/server/jdt-language-server-0.9.0-201711302113.tar.gz instead of ~/.config/coc/extensions/coc-java-data/server/jdt-language-server-latest.tar.gz which currently corresponds to jdt-language-server-0.68.0-202012242230.tar.gz. Version 0.9 was probably an error from Eclipse. It is annoying because it renders java.updateLanguageServer unusable. Besides version 0.9.0 leads to Uncaught exception: Header must provide a Content-Length property.

nicobao avatar Jan 04 '21 17:01 nicobao

Okay, now it works, and it is logical from the source code:

https://github.com/neoclide/coc-java/blob/master/src/downloader.ts#L25

It was downloading the wrong version of Eclipse.jdt.ls. I cannot reproduce the issue. I think it is because I already had 0.9 in that directory (I had put it there myself), and somehow the command didn't replace this old tar.gz with latest.

After I manually cleant the directory ~/.config/coc/extensions/coc-java-data/server/ and copied+untarred jdt-language-server-latest.tar.gz, the command java.updateLanguageServer now seems to work.........

nicobao avatar Jan 04 '21 17:01 nicobao

From the previous comment, maybe there is a bug when trying to download the newest server and the content of ~/.config/coc/extensions/coc-java-data/server/ contains already a specific version?...

nicobao avatar Jan 04 '21 18:01 nicobao

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 used bundled jdt.ls instead.

chemzqm avatar Jan 29 '23 09:01 chemzqm