JDK_HOME can be sorted after lower-priority auto-detected JDK sources
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- java, typescript, vscode
- Domain
- developer-experience, tooling
Research direction
Locate sortJdksBySource() and inspect how a rank of 0 is checked against the assigned-rank condition. Reproduce the JDK_HOME and JAVA_HOME or PATH setup, then verify that the JDK_HOME entry appears first in Java: Configure Java Runtime.
Written by the indexing model from the issue text.
Description
Describe the bug
When the Java home settings are not set, a JDK configured through JDK_HOME may not be listed first if another JDK is also detected from JAVA_HOME or PATH.
JDK_HOME seems to be intended as the highest-priority source.
To Reproduce
- Leave java.jdt.ls.java.home, java.home, and java.configuration.runtimes unset.
- Make sure java.configuration.detectJdksAtStart is enabled.
- Configure JDK_HOME with one valid JDK.
- Configure JAVA_HOME, or PATH, with a different valid JDK.
- Restart VS Code.
- Open Java: Configure Java Runtime and check the detected JDK order.
Actual behavior
The JDK from JDK_HOME may appear after the other detected JDK.
Expected behavior
The JDK from JDK_HOME should appear first.
Environment
- Operating System: macOS
- JDK version: JDK 17 from JDK_HOME, JDK 25 from JAVA_HOME
- Visual Studio Code version: 1.125.0-insider
- Java extension version: 1.55.0
Additional Information
sortJdksBySource() gives JDK_HOME rank 0, but the later rank check does not treat 0 as an assigned rank.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 547
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Contributor guide
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 redhat-developer/vscode-java
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
redhat-developer/vscode-java#4506 · 3 comments · 4 reactions ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
redhat-developer/vscode-java#4505 · 2 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
redhat-developer/vscode-java#4504 · 3 comments · 1 reaction ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 62/100
redhat-developer/vscode-java#4502 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 38/100
redhat-developer/vscode-java#4500 · 3 comments ·
All issues in redhat-developer/vscode-java
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vicharanashala/fln#563 ·