mfussenegger / nvim-jdtls

Extensions for the built-in LSP support in Neovim for eclipse.jdt.ls
GNU General Public License v3.0
979 stars 62 forks source link

Problem with Java 21 #584

Closed javiorfo closed 7 months ago

javiorfo commented 7 months ago

LSP client configuration

No response

Eclipse.jdt.ls version

1.29.0

Steps to Reproduce

Hi, I've been using this plugin for 2 years. Never a problem but with Java 21 appears that is not working. I deleted .metadata before changing from Java 17 to Java 21

Expected Result

I don't know if nvim-jdtls works with Java versions up to 17 (please close this issue if It doesn't).

Actual Result

These are the logs: [ERROR][2023-11-15 16:25:33] ...lsp/handlers.lua:535 "15 nov 2023 16:25:33 Command _java.reloadBundles.command not supported on client" [ERROR][2023-11-15 16:25:33] ...lsp/handlers.lua:535 "15 nov 2023 16:25:33 Error occured while building workspace. Details: \n message: Project configurator 'org.eclipse.buildship.configurators.base' failed to configure project 'java-archetype-spring3-keycloak'; code: 0; resource: /home/javier/workspace/java-archetype-spring3-keycloak;\n message: Unbound classpath container: 'JRE System Library [JavaSE-21]' in project 'java-archetype-spring3-keycloak'; code: 963; resource: /home/javier/workspace/java-archetype-spring3-keycloak;\n message: The project cannot be built until build path errors are resolved; code: 0; resource: /home/javier/workspace/java-archetype-spring3-keycloak;"

mfussenegger commented 7 months ago

Support for java 21 was only merged 2 weeks ago in eclipse.jdt.ls - it's not inclued in 1.29.0. You'd have to build it from master or use a dev snapshot.

(eclipse.jdt.ls itself can be started with 21, but the language level 21 on the project you're developing on won't be fully supported before)

Also reading of buildship in the error message: If it's a gradle project, gradle also always requires an update to support newer java version.

javiorfo commented 7 months ago

Support for java 21 was only merged 2 weeks ago in eclipse.jdt.ls - it's not inclued in 1.29.0. You'd have to build it from master or use a dev snapshot.

(eclipse.jdt.ls itself can be started with 21, but the language level 21 on the project you're developing on won't be fully supported before)

Also reading of buildship in the error message: If it's a gradle project, gradle also always requires an update to support newer java version.

Thanks for the quick reply!! My project uses Gradle 8.4 which supports Java 21 (in fact, it perfectly compiles). Surely the problem is what you mention about jdtls itself. I going to try building from master or snapshot dev. I close the issue.

Thanks again for your answer! Have a good day!