javavscode
javavscode copied to clipboard
Suport environment variables in `jdk.project.jdkhome` settings
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.
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.
This doesn't work when the language server and the project need to use different JDKs.