-
I have jdtls = function()
require('java').setup {}
require('lspconfig').jdtls.setup {
-- Your custom jdtls settings goes here
settings = {
java = {
configuration = {
runtimes = {
{
name = 'JavaSE-21',
path = '/usr/lib/jvm/java-21-openjdk/',
default = true,
},
},
},
},
},
}
end, in my init.lua file but when I open nvim it starts installing jdk17 every time and doesn't install 21. I'm running neovim on arch via wsl. I confirmed I have open jdk 21 installed. $pacman -Qs jdk
local/jdk21-openjdk 21.0.4.u7-1
OpenJDK Java 21 development kit I'm using kickstart.nvim, and made sure to follow the example modifications. I also made made sure my $JAVA_HOME and $PATH were set correctly to point to the open jdk 21 install. I noticed that in the jdtls repo it says it only supports up to java 19, but in this repo the example for setting a different java version uses 21. Is this the issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We are not installing any JDKs other than 17 for running jdtls. The configuration is there for you to set the path to already installed JDK withing your system already. When you have it set, based on the project, jdtls will pick the correct JDK to use. |
Beta Was this translation helpful? Give feedback.
We are not installing any JDKs other than 17 for running jdtls. The configuration is there for you to set the path to already installed JDK withing your system already. When you have it set, based on the project, jdtls will pick the correct JDK to use.