Skip to content

camel.ls.java.home should use the Java execution environment name #2206

@x80486

Description

@x80486

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"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    IMPROVEMENTNew feature or an enhancement of current feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions