emacs-lsp / lsp-java

lsp-mode :heart: java
https://emacs-lsp.github.io/lsp-java
GNU General Public License v3.0
648 stars 90 forks source link

Support for newest version of JDK 20, 21? #458

Open oscarvarto opened 1 year ago

oscarvarto commented 1 year ago

Sorry if this is too soon. It seems that eclipse.jdtls already supports JDK 20

https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/2898#issuecomment-1752102021

Will we have support for JDK 21 in emacs too?

nithin-mk commented 5 months ago

Right now, lsp-java is downloading an older version of eclipse-jdtls (1.23.0), which doesn't support Java 21. eclipse-jdtls 1.35.0 supports up to Java 22. Can we please get an updated release of lsp-java?

https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request

ArneBab commented 3 months ago

To download on Java 21, I also had to (setenv "MAVEN_OPTS" "--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED")

nithin-mk commented 3 months ago

@ArneBab In which file should I set those options?

ArneBab commented 3 months ago

I just put that in my init.el into the use-package declaration of lsp-java. I don’t have it working correctly at the moment, though ⇒ more problems to solve. This change just enables downloading jdtls with modern Java installed.