java.home specifies the folder path to the JDK, which should be like /usr/java/jdk16.

Despite manually pointing to the path, we can click it from GUI. Open Command Palette and choose Java: Configure Java Runtime. Below the option Java Tooling Runtime, the value of JDK for Language Server is equal to java.home.

If there's no optional path there, check if you've added java to PATH.

Reference: Installation of JDK on Linux Platforms. and Using Java runtime configuration wizard.

Answer from Molly Wang-MSFT on Stack Overflow
Discussions

java.configuration.runtimes in settings.json are ignored
[provide a description of the issue] Environment Operating System: Ubuntu linux 20.10 JDK version: several -- 1.8, 16 Visual Studio Code version: 1.52.1 Java extension version: v0.78.0 Steps To Rep... More on github.com
🌐 github.com
6
June 25, 2021
java : runtime not compatible with 'javaSE-16' environment
Set the jdk you use to compile and run .java file as the same one, this question should be solved. Open Command Palette and choose Java: Configure Java Runtime, about Project JDKs, select the same one as Java Tooling Runtime, then reload window to make the change effective. More on reddit.com
🌐 r/vscode
5
1
April 18, 2021
I try to "Configure Java Runtime", but it's blank page
I use vscode command "Java: Configure Java Runtime", and enter the tab "Configure Java Runtime", but i got a blank page finally. then i taggle the vscode developer tool, the con... More on github.com
🌐 github.com
3
April 28, 2024
visual studio code - VSCode can't change Java Version in "Configure Java Runtime" - Stack Overflow
Im trying to configure a Java Web project in VSCode and want to use Java 8 for a project. Configure Java Classpath Window The value "Java Version" is set to 19 and i can select other vers... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com › redhat-developer › vscode-java › issues › 2625
java.configuration.runtimes not working · Issue #2625 · redhat-developer/vscode-java
August 11, 2022 - java.configuration.runtimes does not work at all and I cannot use any other JDKs except the one VSCode chooses by default.
Author   redhat-developer
🌐
GitHub
github.com › microsoft › vscode-java-pack › issues › 1316
I try to "Configure Java Runtime", but it's blank page · Issue #1316 · microsoft/vscode-java-pack
April 28, 2024 - I use vscode command "Java: Configure Java Runtime", and enter the tab "Configure Java Runtime", but i got a blank page finally. then i taggle the vscode developer tool, the console show: workbench.desktop.main.js:152 [Extension Host] stack trace: TypeError: Cannot read properties of undefined (reading 'includes') at t.getProjectType (/Users/jichunxu/.vscode/extensions/vscjava.vscode-java-pack-0.26.0/out/extension.js:2:850519) at /Users/jichunxu/.vscode/extensions/vscjava.vscode-java-pack-0.26.0/out/extension.js:2:815780 at Generator.next () at a (/Users/jichunxu/.vscode/extensions/vscjava.vsc
Author   microsoft
🌐
Visual Studio Code
code.visualstudio.com › docs › java › java-project
Managing Java Projects in VS Code
November 3, 2021 - As Java evolves, it's common that developers work with multiple versions of JDK. You can map them to your local installation paths via the setting: java.configuration.runtimes.
Find elsewhere
🌐
GitHub
github.com › redhat-developer › vscode-java › issues › 2201
"Configure Java runtime" gives no option to install macOS arm64 JDK · Issue #2201 · redhat-developer/vscode-java
November 8, 2021 - VS Code offers to install aarch64 java. Observe that the install options given are only for Mac x64 and not ARM64, even though adoptium.net has aarch64 builds of jdk17 for macOS.
Author   redhat-developer
🌐
Microsoft
devblogs.microsoft.com › dev blogs › microsoft for java developers › java on visual studio code update – november 2020
Java on Visual Studio Code Update – November 2020 - Microsoft for Java Developers
December 15, 2020 - When you see a thumbs up icon on status bar, your project is loaded. Ctrl+Shift+P to launch command palette and then use command “Java: Configure Java Runtime” to launch the wizard. Project JDKs tab on the wizard configures JDK for project.
🌐
GitHub
github.com › microsoft › vscode-java-debug › issues › 879
Correct use of java.configuration.runtimes for debug configuration · Issue #879 · microsoft/vscode-java-debug
September 7, 2020 - How to use java.configuration.runtimes? I have below settings, purposely removed 1.8 from the configuration so that my code runs on 1.11 and when I run the debugger still java version used is 1.8 "java.configuration.runtimes": [ { "name"...
Author   microsoft
🌐
GitHub
github.com › redhat-developer › vscode-java › issues › 1684
feature request: select java runtime in vs code settings · Issue #1684 · redhat-developer/vscode-java
October 28, 2020 - The current state of Java runtime support seems to be: this extension needs Java 11 you can specify available runtimes in java.configuration.runtimes however you can't specify/force which of these versions to use in a project; instead th...
Author   redhat-developer
🌐
Reddit
reddit.com › r/visualstudio › setting up vscode with java
r/VisualStudio on Reddit: Setting Up VSCode with Java
September 30, 2023 -

Getting this error message when I am trying to set my default jdk. Not sure what the issue is.

** Invalid runtime for JavaSE-21: Runtime at 'C:\Program Files\Java\jdk-21' is not compatible with the 'JavaSE-21' environment. **

Heres my json settings for reference:

{
"workbench.colorTheme": "Tomorrow Night Blue",
"redhat.telemetry.enabled": true,
"java.configuration.runtimes": [

{
"name": "JavaSE-21",
"path":"C:\\Program Files\\Java\\jdk-21",
"default": true
},
],
"java.jdt.ls.java.home":"C:\\Program Files\\Java\\jdk-21",

}

🌐
GitHub
github.com › redhat-developer › vscode-java › issues › 2255
Cannot add Java 18+ runtime to java.configuration.runtimes without mislabeling it as JavaSE-17 or below. · Issue #2255 · redhat-developer/vscode-java
December 20, 2021 - Note how VS Code shows an error for that code, saying it doesn't recognize it: In settings, try to add the Java 18 JDK to the runtimes.
Author   redhat-developer
🌐
GitHub
github.com › redhat-developer › vscode-java › issues › 2778
Unable to configure classpath/java runtime · Issue #2778 · redhat-developer/vscode-java
November 3, 2022 - Since upgrading VSCode the "Configure Java Runtime" and "Configure Classpath" windows are empty. Environment Operating System: MacOS (Darwin x64 21.6.0) JDK version: 17.0.5 (Ecl...
Author   redhat-developer
🌐
Visual Studio Code
code.visualstudio.com › docs › java › java-tutorial
Getting Started with Java in VS Code
November 3, 2021 - The Extension Pack for Java supports Java version 1.8 or above. Note: To configure JDKs for your projects, see Configure Runtime for Projects.