Feature Request: Set `default` in `java.configuration.runtimes` to the workspace environment variable JAVA_HOME
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java, vscode
- Domain
- developer-experience, tooling
Research direction
Start by reviewing the related VS Code API issue #152806 and the workspace and user settings examples in this issue. Done means determining whether workspace process.env.JAVA_HOME can override the default Java runtime independently of the system environment, with the behavior applying to the listed Java-related settings.
Written by the indexing model from the issue text.
Description
Currently, the default of the Java extension java.configuration.runtimes is used as the default for No Build Tools, but it would be useful to set it to the environment variable JAVA_HOME which is valid for each workspace. The environment variable here is not the terminal, but process.env.JAVA_HOME, which is referenced by extensions such as
java.import.gradle.java.home
Setting > java.jdt.ls.java.home > JAVA_HOME > PATHmaven.terminal.customEnv
Setting > JAVA_HOMEjava.jdt.ls.java.home
Setting > Embedded JRE > JDK_HOME > JAVA_HOME > PATHspring-boot.ls.java.home
Setting > Embedded JRE > JAVA_HOME > PATHrsp-ui.rsp.java.home
Setting > JDK_HOME > JAVA_HOME> Windows Registry > PATHsalesforcedx-vscode-apex.java.home
Setting > JDK_HOME > JAVA_HOME> Windows Registry > PATHplantuml.java
Setting > PATH
The goal is to be able to use a different JAVA_HOME for each workspace, independent of the system's JAVA_HOME environment variable. For example:
User settings.json
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "/path/to/java/17",
"default": true
},
{
"name": "JavaSE-21",
"path": "/path/to/java/21",
}
],
Workspace settings.json (Override default runtime to JavaSE-21)
"java.configuration.runtimes": [
{
"name": "JavaSE-21",
"path": "/path/to/java/21",
"default": true
}
],
java.configuration.runtimes is a Red Hat extension, but I am posting it here because I believe it needs to be supported by VSCode itself. It is related to the following issues.
#152806 API: allow an extension to change the environment variables
- Dominant language
- TypeScript
- Stars
- 352
- Forks
- 166
- Avg merge
- 17h 47m
- Merged PRs (30d)
- 32
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-java-pack
-
Memory Leak in Linux Openai-triaged bug
Difficulty 4/5 3-5 days Newbie friendliness 42/100
microsoft/vscode-java-pack#1543 · 8 comments · 4 reactions ·
-
ai-triaged bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/vscode-java-pack#1443 · 1 comment · 2 reactions ·
-
ai-triaged bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
microsoft/vscode-java-pack#1425 · 1 comment ·
-
ai-triaged enhancement feature-request
Difficulty 5/5 Over a week Newbie friendliness 20/100
microsoft/vscode-java-pack#1423 · 2 comments · 1 reaction ·
-
ai-triaged area/jdtls bug needs-investigation
Difficulty 4/5 3-5 days Newbie friendliness 25/100
microsoft/vscode-java-pack#1420 · 1 comment ·
All issues in microsoft/vscode-java-pack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·