Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

jdtls does not work #763

Open
1 of 2 tasks
aman7000 opened this issue Jun 8, 2022 · 18 comments
Open
1 of 2 tasks

jdtls does not work #763

aman7000 opened this issue Jun 8, 2022 · 18 comments

Comments

@aman7000
Copy link

aman7000 commented Jun 8, 2022

Problem description

Java lsp does not work

Why do you think this is an issue with nvim-lsp-installer?

getting error on java file, instead of lsp loading. Error:-
Client 1 quit with exit code 13 and signal 0

Neovim version (>= 0.7)

NVIM 0.7.0

Operating system/version

Mac

I've manually reviewed the Nvim LPS client log (:LspLog) to find potential errors

  • Yes

I've recently downloaded the latest plugin version of both nvim-lsp-installer and nvim-lspconfig

  • Yes

Affected language servers

java

Steps to reproduce

  1. Install java server with :LspInstall java
  2. Open java file to see the error

Actual behavior

error comes:
Client 1 quit with exit code 1 and signal 0

Expected behavior

java Lsp should work

LspInfo

Language client log: /Users/amansingh/.cache/nvim/lsp.log
 Detected filetype:   java
 
 0 client(s) attached to this buffer: 
 
 Other clients that match the filetype: java
 
 Config: jdtls
 	filetypes:         java
 	root directory:    /Users/amansingh/workspace/java/nbfc
 	cmd:               /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/home/jre/bin/java -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Dlog.protocol=true -Dlog.level=ALL -Xms1g -Xmx2G -javaagent:/Users/amansingh/.local/share/nvim/lsp_servers/jdtls/lombok.jar --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -jar /Users/amansingh/.local/share/nvim/lsp_servers/jdtls/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar -configuration /Users/amansingh/.local/share/nvim/lsp_servers/jdtls/config_mac -data /Users/amansingh/workspace/nbfc
 	cmd is executable: false (checked by nvim-lsp-installer)
 	                   Make sure you have set up nvim-lsp-installer (:h nvim-lsp-installer-quickstart)
 	autostart:         true
 	custom handlers:   language/status, textDocument/rename, workspace/applyEdit, textDocument/codeAction
 
 Configured servers list: jsonls, tsserver, tailw

LspLog

No response

Healthcheck

nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - OK: neovim version >= 0.7.0
  - OK: **Go**: `go version go1.18 darwin/arm64`
  - OK: **cargo**: `cargo 1.61.0 (a028ae42f 2022-04-29)`
  - WARNING: **luarocks**: not available
  - OK: **Ruby**: `ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]`
  - OK: **RubyGem**: `3.0.3.1`
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - OK: **npm**: `8.1.0`
  - OK: **node**: `v16.13.0`
  - OK: **python3**: `Python 3.9.13`
  - OK: **pip3**: `pip 22.1.1 from /opt/homebrew/lib/python3.9/site-packages/pip (python 3.9)`
  - OK: **javac**: `javac 11.0.15`
  - OK: **java**: `Ok`
  - WARNING: **julia**: not available
  - OK: **wget**: `GNU Wget 1.21.3 built on darwin21.3.0.`
  - OK: **curl**: `curl 7.79.1 (x86_64-apple-darwin21.0) libcurl/7.79.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.45.1`
  - OK: **gzip**: `Apple gzip 353.100.22`
  - OK: **tar**: `bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 `
  - OK: **bash**: `GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)`
  - OK: **sh**: `Ok`
  - OK: GitHub API rate limit. Used: 12. Remaining: 48. Limit: 60. Reset: Wed Jun  8 21:53:23 2022.

Screenshots or recordings

Screen Shot 2022-06-08 at 9 13 13 PM

@williamboman
Copy link
Owner

Hello! It seems like you have the JAVA_HOME environment variable defined. This variable is used to locate the user's installation of Java. Are you sure it's pointing to a valid installation? If it's not, you probably want to unset it altogether (if java is already in your PATH), or set it to a valid directory

@aman7000
Copy link
Author

aman7000 commented Jun 9, 2022 via email

@williamboman
Copy link
Owner

Have you checked the :LspLog logs?

@aman7000
Copy link
Author

:LspLog is fine

@aman7000
Copy link
Author

[START][2022-06-09 13:13:11] LSP logging initiated
[START][2022-06-09 13:15:29] LSP logging initiated
[START][2022-06-09 13:17:03] LSP logging initiated
[START][2022-06-09 13:22:09] LSP logging initiated
[START][2022-06-09 13:28:06] LSP logging initiated
[START][2022-06-09 13:24:22] LSP logging initiated
[START][2022-06-10 18:24:19] LSP logging initiated
[START][2022-06-10 18:40:07] LSP logging initiated
[START][2022-06-10 18:47:30] LSP logging initiated
[START][2022-06-11 13:17:27] LSP logging initiated
[START][2022-06-11 13:45:52] LSP logging initiated
[START][2022-06-11 13:46:05] LSP logging initiated
[START][2022-06-11 13:46:33] LSP logging initiated
[START][2022-06-11 15:21:48] LSP logging initiated

@aman7000
Copy link
Author

java lsp Just doesn't work ...

@williamboman
Copy link
Owner

Try setting a lower log level to capture more information in :LspLog (see :h lspconfig-logging for how to do so). Do you see anything that could be helpful in your troubleshooting then?

@Bear-03
Copy link

Bear-03 commented Jun 12, 2022

I have the same problem. I don't see any errors being printed to the logs anymore (even witht the log level set to "info"), but I remember it used to say SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder after the server exited.

@asmodeus812
Copy link

asmodeus812 commented Jun 13, 2022

I want to chime on this as well, after LspInstall jdtls today i saw the same issue, i believe this is likely JDTLS itself, being very unstable, possibly the most unstable language server i have ever seen. Pretty much every time i update that it breaks something or has issues starting, or you have to delete th workspaces folder to make it work, it is very, very bad.

Now what i propose is for people to use the milestone builds - for example i just downgraded to this one - https://download.eclipse.org/jdtls/milestones/1.9.0/.

I think LSP insatller should consider using milestone builds instead of snapshots, those seem to be more stable (better tested maybe, i can not really confirm).

Note: Going through their commits, i noticed that they might be trying to migrate to java17, maybe already have, which means that the next release will mandate 17 and may not even work on 11. But nobody really communicates that with the community.

@Bear-03
Copy link

Bear-03 commented Jun 13, 2022

Is there any way to downgrade via nvim-lsp-installer itself or would I have to do it manually?

@asmodeus812
Copy link

asmodeus812 commented Jun 13, 2022

I don't think so, downgrade is rather simple, download the tar ball and unzip the contents to the data folder - /home/{user}/.local\share\nvim\lsp_servers\jdtls . I suggest delete everything in that folder first, without lombok (if you are using it, since milestone builds don't come with lombok i think, or you can also update lombok manually if you choose to do so) Then paste the contents of the archive. Avoid calling LspInstall jdtls or LspUpdate etc.

@Bear-03
Copy link

Bear-03 commented Jun 13, 2022

Alright, thanks!

@williamboman
Copy link
Owner

You can specify version via LspInstall, like so:

:LspInstall jdtls@1.9.0-something

@williamboman
Copy link
Owner

As for using milestone releases instead of snapshots - I think that makes sense! The reasons snapshots are currently used is because that's what the vscode plugin does. It seems like they don't provide the same endpoints to fetch the latest milestone, which they provide for snapshots, so that complicates things a bit.

@s1n7ax
Copy link
Contributor

s1n7ax commented Jun 27, 2022

You don't have to go all the way to 1.9. :LspInstall [email protected] works.

@s1n7ax
Copy link
Contributor

s1n7ax commented Jun 27, 2022

@williamboman Is it possible to have versions? something like [email protected] in the config and auto install the specific version. At the moment it complains because the LS doesn't exist.

@williamboman
Copy link
Owner

You can do something like

require("nvim-lsp-installer").setup {
    ensure_installed = { "[email protected]" },
    automatic_installation = { exclude = { "jdtls" } }
}

@RaafatTurki
Copy link

Same issue, switching to java 17 fixed it.
I'm not that versed in java version management chicanery, can I tell jdtls to use one version so I'd keep the rest of my system on another?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants