`java.jdt.ls.java.home` should use the Java execution environment name
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- java, typescript, vscode
调研方向
未指定实现文件或测试。首先处理 java.jdt.ls.java.home 和 java.configuration.runtimes,并使用 .vscode/settings.json 示例作为工作区级别的入口点。完成的标准是,项目可以通过执行环境名称选择运行时,同时每个用户都能将该名称解析为自己的 JDK 路径。
由索引模型根据 Issue 内容生成。
描述
Description
I've been trying to configure several Java projects in Visual Studio Code and have noticed that the java.jdt.ls.java.home setting, among others, is always required.
This setting belongs in the project's workspace (unless you work in one project, or have a perfectly aligned setup), but it cannot be set as such because for a multi-user project, each one will definitely have a different path for the JDK.
I think it would be great if this setting could take the (reference) value of one the existing Java execution environments instead, and tries to read the path of the corresponding JDK. This way, the configuration is fixed, set at the project level, and only needs to change if the project upgrades to a newer JDK.
For instance:
// Global User Settings
{
...
"java.configuration.runtimes": [
{
"javadoc": "https://docs.oracle.com/en/java/javase/17/docs/api/index.html",
"name": "JavaSE-17",
"path": "/home/x80486/.local/share/mise/installs/java/temurin-17",
"sources": "/home/x80486/.local/share/mise/installs/java/temurin-17/lib/src.zip"
},
{
"default": true,
"javadoc": "https://docs.oracle.com/en/java/javase/21/docs/api/index.html",
"name": "JavaSE-21",
"path": "/home/x80486/.local/share/mise/installs/java/temurin-21",
"sources": "/home/x80486/.local/share/mise/installs/java/temurin-21/lib/src.zip"
}
],
...
}
Then for each project I work on, I could just set in .vscode/settings.json:
{
"java.jdt.ls.java.home": "JavaSE-21"
}
Additional Context
This is just an idea with the existing settings. It may be even more appropriate to define something new that could unify all the settings that request the location of the JDK, but it should always refer in one way or another to the java.configuration.runtimes (preferably by name), otherwise it's impossible to set this correctly —in a way that works for everyone regardless of the architecture and location/installation of the Java SDK—, at the project level.
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 547
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
redhat-developer/vscode-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
redhat-developer/vscode-java#4426 ·
-
bug
难度 4/5 3-5 天 新手友好度 45/100
redhat-developer/vscode-java#4506 · 3 条评论 · 4 个 reaction ·
-
bug
难度 4/5 3-5 天 新手友好度 45/100
redhat-developer/vscode-java#4505 · 2 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 52/100
redhat-developer/vscode-java#4504 · 3 条评论 · 1 个 reaction ·
-
bug
难度 3/5 1-2 天 新手友好度 62/100
redhat-developer/vscode-java#4502 ·
查看 redhat-developer/vscode-java 的全部 Issue
相似的 Issue
-
Type/Bug
难度 2/5 1-3 小时 新手友好度 78/100
OpenNSW/nsw-srilanka#497 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
难度 1/5 1 小时以内 新手友好度 88/100
digidem/comapeo-cloud-app#403 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 78/100