Configure JDTLS to run with specific Java version #1893
Unanswered
fancywriter
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello. I am working on some legacy projects. Typical in Java world. I have to work on Java-17 and Java-8 code base (I know it could be worse like Java-6 or even Java-5, very typical).
This is what my JAVA_HOME is configured in the project, the project is built with gradle (but should be similar with Maven or any other tool) and it requires that older java version, it won't work with 21 or 23.
However, JDTLS requires at least Java-21 and fails to work with Java-17.
How can I configure Mason to use (I can even hardcode path to java there) to use specific JRE only for JDTLS (but use JAVA_HOME elsewhere, like for running gradle/maven or code linters from other nvim plugins) ?
I use LazyVIM.
I tried to create
~/.config/nvim/lua/plugins/jdtls.lua
But I see it still tries to use Java-17, completely ignores all of this. Because it's installed by mason... how to configure mason properly for this?
I just want to configure it once and forget forever (or until it stop work under <=Java-23 for instance, far future I expect).
Beta Was this translation helpful? Give feedback.
All reactions