Open bAmrish opened 1 year ago
Looks like you need to set JAVA_HOME to be at least Java 18 (not 11 or 1.8 (which is version 8, not 18)).
How does this make sense? I'm running into the same issue setting up my environment. I'm not configuring Java 18 because its not LTS, and everything we are writing is written using Java 17. Is there a way to install a previous version of the language server that uses 17 instead? Surely everyone who wants to write Java and use the java-language-server can't be expected to use whatever version the language server specifies...
Edit: ...and Java 18 isn't even an option in the standard Arch repos.
I was just trying to be of assistance. Java 21 is LTS and is released now.
@badloop Actually, you can use Java 21 (LTS) which will satisfy the Java 18 requirement. Of course, the documentation should be updated to require at least Java 18 (see https://github.com/georgewfraser/java-language-server/pull/271).
Hi, is there any updates on this? I cannot update my java version since all our code is incompatible with Java 18. Is there anyway to make it work with Java 11?
This was exactly the issue I came across and updating to v21 worked, thank you!
I use the sdkman
tool for easily managing java versions, here it is if you're curious.
Using v21 got me working as well
I understand what he means. He doesn’t want the JAVA_HOME to be set to the newer version, but rather to the version he uses in his projects, to avoid any kind of incompatibility.
So, I think the point is how to set different Java versions, one for this project and another for the Java Language Server, so it won’t lead to an error.
Since it's a setup problem and not a issue with the lsp, I think this issue can be closed.
Java 18 is an odd choice. I just manually changed it to 17 in pom.xml and it compiled just fine. Please change that to Java 17. There's still plenty of software that doesn't run on Java 21 and I don't see a way to use Java 21 only for java-language-server and 17 for the rest of my workspace.
Java 18 is an odd choice. I just manually changed it to 17 in pom.xml and it compiled just fine. Please change that to Java 17. There's still plenty of software that doesn't run on Java 21 and I don't see a way to use Java 21 only for java-language-server and 17 for the rest of my workspace.
How did you change this? Would you mind giving me the step by step to change it myself? Specifically, where should I download the repo to so that Mason can find it?
@jonathanabennett , I ended up not using this lsp, I don't remember for what reason. I think I modified the pom file outside of mason, just to check if it'll manually compile.
The changes necessary in pom.xml which should be at the top level are:
`
I am trying to setup my neovim instance with Java LSP. I am using Mason to help install the LSPs. When installing java lsp I am getting following error:
I have tried setting
JAVA_HOME
to both11
and1.8
, but I get the same error.Here is the full log of the error
Please let me know how to fix the error or if you need any more information.