r/learnjava • u/GummiGumBear • Sep 21 '26
java.jdt.ls.java.home variable does not point to a JDK?
I'm doing the MOOC Java course, but I'm getting an error when opening VSCode, which prevents me from running my code. The error is:
The java.jdt.ls.java.home variable defined in Visual Studio Code settings (C:\Program Files\Eclipse Adoptium\jdk-21.0.11.10-hotspot) does not point to a JDK.
Source: Language Support for Java(TM) by Red HatMy settings are correct as far as I can tell. The path refers to the folder cotaining the bin folder:
"java.jdt.ls.java.home": "C:\\Program Files\\Eclipse Adoptium\\jdk-21.0.11.10-hotspot",
"java.configuration.runtimes": [
{
"name": "JavaSE-11",
"path": "C:\\Program Files\\Eclipse Adoptium\\jdk-11.0.31.11-hotspot",
"default": false,
},
{
"name": "JavaSE-21",
"path": "C:\\Program Files\\Eclipse Adoptium\\jdk-21.0.11.10-hotspot",
"default": true,
},
],edit; I fixed it, see here. Any idea what causes the error and how to fix it? The only solutions I could find said to change/correct the settings above, but since those are correct already... VSCode ( 1.138.0) and all extensions (Language Support for Java 1.56.0) are up-to-date btw.