williamboman / nvim-lsp-installer

Further development has moved to https://github.com/williamboman/mason.nvim!
https://github.com/williamboman/mason.nvim
Apache License 2.0
2k stars 123 forks source link

JDTLS not Launching Properly #552

Closed Balrrach closed 2 years ago

Balrrach commented 2 years ago

Problem description

JDTLS doesn't seem to be launched correctly on first instance.

Neovim version (>= 0.6)

NVIM v0.6.1 Build type: Release LuaJIT 2.1.0-beta3 Compiled by builduser

Operating system/version

5.10.105-1-MANJARO

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

Affected language servers

JDTLS

Steps to reproduce

nvim file.java

Actual behavior

  1. None of the language server features like autocompletion, goto defition... will work
  2. Some errors among the following may popup:
    • The declared package "route.file" does not match the expected package "". Link
    • file.java is not on the classpath of project, only syntax errors are reported. Link
    • The import core cannot be resolved. Link Some of these errors are known to be related to the language server directly and not related to the project and, in fact, can be often solved by just executing a cleaning or relaunching the editor(Eclipse often). In my case I know these errors are related to JDTLS because there is a way to fix it that has nothing to do with the project. To fix it, it is enough with executing:
  3. :LspStop
  4. :LspStart Those two commands solve all problems and the language server is correctly launched. :LspRestart get's rid of the errors but doesn't seem to launch the language server since no features work.

I can assure that if the language server is installed and configured like pointed in lsp-config guide it all works correctly.

Expected behavior

JDTLS to be launched correctly

LspInfo

Language client log: /home/balrrach/.cache/nvim/lsp.log
 Detected filetype:   java

 1 client(s) attached to this buffer: 

 Client: jdtls (id: 1, pid: 59720, bufnr: [1])
    filetypes:       java
    autostart:       true
    root directory:  /home/balrrach/Documents/Universidad/Quinto/Segundo Cuatrimestre/tsi/Practica/practica1/GVGAI
    cmd:             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 --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -jar /home/balrrach/.local/opt/jdtls-launcher/jdtls/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar -configuration /home/balrrach/.local/opt/jdtls-launcher/jdtls/config_linux -data /home/balrrach/workspace

 Configured servers list: clangd, jdtls

Healthcheck

nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - OK: neovim version >= 0.6.0
  - WARNING: **Go**: not available
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - ERROR: **npm**: not available
  - ERROR: **node**: not available
  - WARNING: **julia**: not available
  - OK: **tar**: `tar (GNU tar) 1.34`
  - OK: **gzip**: `gzip 1.11`
  - OK: **python3**: `Python 3.10.2`
  - OK: **Ruby**: `ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux]`
  - OK: **wget**: `GNU Wget 1.21.2 built on linux-gnu.`
  - OK: **sh**: `Ok`
  - OK: **bash**: `GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)`
  - OK: **curl**: `curl 7.82.0 (x86_64-pc-linux-gnu) libcurl/7.82.0 OpenSSL/1.1.1m zlib/1.2.11 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.2 libpsl/0.21.1 (+libidn2/2.3.0) libssh2/1.10.0 nghttp2/1.47.0`
  - WARNING: **pip3**: not available
  - OK: **java**: `Ok`
  - OK: **RubyGem**: `3.3.5`
  - OK: **javac**: `javac 17.0.3`

Screenshots or recordings

No response

williamboman commented 2 years ago

Hello! The server works fine for me on multiple systems. I'm not sure I can help unless there's a bit more info in terms of how to reproduce it. Does this happen if you run it with the minimal_debug_init.lua (for example $ nvim -u ~/Downloads/minimal_debug_init.lua)?

Balrrach commented 2 years ago

I decided to uninstall the language server with the plugin and install it manually and configure it like it is advised by Lspconfig and it works correctly. I've tried to install the server again with the plugin and I can't, I get the following screen and the server never installs: image Anyway, since the server doesn't install, I got it working correctly and it works for you there must be an issue with my config or something strange. Let's leave it as is. Thanks a lot anyway!

williamboman commented 2 years ago

Anyway, since the server doesn't install, I got it working correctly and it works for you there must be an issue with my config or something strange. Let's leave it as is. Thanks a lot anyway!

Ah, cool! So the mirror that it downloads the jar file from has a tendency to be extremely slow, it could be that it actually is making progress but just reaallllyyy slowly. Nice to hear that you solved it :+1:, if you still want to figure out what the problem was I'd be happy to assist (getting a reproducible case would help tremendously)!