-
Notifications
You must be signed in to change notification settings - Fork 13
Description
I've been trying to configure several Java projects in Visual Studio Code and have noticed that the java.jdt.ls.java.home
setting (among others) is always required.
Each Java-related extension defines a new configuration setting to specify the Java home location.
This setting belongs in the project's workspace (unless you work in one project, or have a perfectly aligned setup), but it cannot be set as such because for a multi-user project, each one will definitely have a different path for the JDK.
I think it would be great if this setting (and hopefully all the others as well) could take the value of one the existing Java execution environments instead, and tries to derive the path
of the corresponding JDK. This way, the configuration is fixed, set at the project level, and only needs to change if the project upgrades to a newer JDK.
For instance:
// Global User Settings
{
...
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "/home/x80486/.local/share/mise/installs/java/temurin-17"
},
{
"default": true,
"name": "JavaSE-21",
"path": "/home/x80486/.local/share/mise/installs/java/temurin-21"
}
],
...
}
Then for each project, we will just need to set in .vscode/settings.json
:
{
"camel.ls.java.home": "JavaSE-XY"
}