redhat-developer / redhat-developer/vscode-java

JDK_HOME can be sorted after lower-priority auto-detected JDK sources

未关闭 适合新手
#4,426 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
2.3k
派生
546
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

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

  1. Leave java.jdt.ls.java.home, java.home, and java.configuration.runtimes unset.
  2. Make sure java.configuration.detectJdksAtStart is enabled.
  3. Configure JDK_HOME with one valid JDK.
  4. Configure JAVA_HOME, or PATH, with a different valid JDK.
  5. Restart VS Code.
  6. 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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

定位 sortJdksBySource(),检查 rank 为 0 时如何与已分配 rank 条件进行比较。复现 JDK_HOME 和 JAVA_HOME 或 PATH 的设置,然后验证 JDK_HOME 条目是否在 Java: Configure Java Runtime 中排在第一位。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, typescript, vscode
领域
developer-experience, tooling
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
冷清
描述清晰度
描述清楚
新手友好度
68/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。