Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suport environment variables in jdk.project.jdkhome settings #392

Open
balthild opened this issue Mar 20, 2025 · 2 comments
Open

Suport environment variables in jdk.project.jdkhome settings #392

balthild opened this issue Mar 20, 2025 · 2 comments
Labels
enhancement New feature or request Settings/Config If there are missing setting or configaration

Comments

@balthild
Copy link

balthild commented Mar 20, 2025

I use nix to manage dev environments, so there's no simple and predictable java home paths. The paths are subject to change each time I update the packages. Therefore, I wish to have a way setting the jdk path from a specific environment veriable.

There's a standard syntax in vscode to do this, i.e.

{
  "jdk.project.jdkhome": "${env:JAVA_HOME_PROJECT}"`
}

However, It is not substituted in config.json out of the box. Therefore, extensions need to do it by themselves, e.g. https://github.com/DominicVonk/vscode-variables.

@Achal1607
Copy link
Member

Hey @balthild,
Thanks for using our extension. As mentioned in the README, we currently read a few environment variables to set the JDK home. As a workaround, you can use these for now, but we plan to extend support for VSCode's environment variable syntax in the future.

@Achal1607 Achal1607 added enhancement New feature or request Settings/Config If there are missing setting or configaration labels Mar 25, 2025
@balthild
Copy link
Author

This doesn't work when the language server and the project need to use different JDKs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Settings/Config If there are missing setting or configaration
Projects
None yet
Development

No branches or pull requests

2 participants