Skip to content

Commit 84a8566

Browse files
1lckclaude
andauthored
fix(java): discover JDKs in the standard Windows and Linux locations (#17)
* fix(java): discover JDKs in the standard Windows and Linux locations The JDK tool definition declared discovery scans for macOS only, so on Windows and Linux no JDK was ever an installation: New Project's JDK picker said no version was installed (1lck/Lithe-IDEA#2032) although runs found one through JAVA_HOME or the PATH. - Windows: C:\Program Files\Java, Eclipse Adoptium, Microsoft (jdk-*), Zulu, Amazon Corretto and BellSoft. - Linux: /usr/lib/jvm. - Windows and Linux: ~/.jdks (JDKs IntelliJ IDEA downloads). - macOS and Linux: ~/.sdkman/candidates/java. Discovery roots are absolute paths because Core only accepts upper-case environment variable names, and Windows spells this one ProgramFiles. A JDK anywhere else is still listed through JAVA_HOME or the PATH (Lithe-core-rust#67). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * release: Java Support 2.0.1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2248d64 commit 84a8566

2 files changed

Lines changed: 118 additions & 1 deletion

File tree

‎docs/releases/v2.0.1.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Java 2.0.1
2+
3+
## 中文
4+
5+
- 修复 Windows 和 Linux 上“新建项目”和工具链设置找不到已安装 JDK 的问题([1lck/Lithe-IDEA#2032](https://github.com/1lck/Lithe-IDEA/issues/2032))。此前插件只为 macOS 声明了 JDK 安装目录。现在新增以下扫描位置:
6+
- Windows:`C:\Program Files` 下的 `Java`、`Eclipse Adoptium`、`Microsoft`(`jdk-*`)、`Zulu`、`Amazon Corretto`、`BellSoft`
7+
- Linux:`/usr/lib/jvm`
8+
- Windows 和 Linux:用户目录下的 `.jdks`
9+
- macOS 和 Linux:SDKMAN 的 `~/.sdkman/candidates/java`
10+
11+
### 兼容性
12+
13+
宿主要求与 2.0.0 相同,只新增了扫描规则,不改变已有设置。装在其他位置的 JDK(例如 `D:\Program Files\...`)仍然只能通过 PATH 或 `JAVA_HOME` 找到;要让这类 JDK 出现在选择器里,需要使用包含 [1lck/Lithe-IDEA#2040](https://github.com/1lck/Lithe-IDEA/pull/2040) 的桌面端版本。
14+
15+
---
16+
17+
## English
18+
19+
- Fix JDK discovery on Windows and Linux, where New Project and the toolchain settings found no installed JDK ([1lck/Lithe-IDEA#2032](https://github.com/1lck/Lithe-IDEA/issues/2032)). The plugin previously declared JDK locations only for macOS. It now also scans:
20+
- Windows: `Java`, `Eclipse Adoptium`, `Microsoft` (`jdk-*`), `Zulu`, `Amazon Corretto` and `BellSoft` under `C:\Program Files`
21+
- Linux: `/usr/lib/jvm`
22+
- Windows and Linux: `.jdks` in the home directory
23+
- macOS and Linux: SDKMAN's `~/.sdkman/candidates/java`
24+
25+
### Compatibility
26+
27+
Host requirements are unchanged from 2.0.0. This release only adds discovery locations and leaves existing settings untouched. A JDK installed elsewhere (for example under `D:\Program Files\...`) is still found only through PATH or `JAVA_HOME`. To list such a JDK in the picker, use a desktop build that includes [1lck/Lithe-IDEA#2040](https://github.com/1lck/Lithe-IDEA/pull/2040).

‎io.github.lithe-idea.java-support/plugin.json‎

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"schemaVersion": 0,
33
"id": "io.github.lithe-idea.java-support",
44
"displayName": "Java Support",
5-
"version": "2.0.0",
5+
"version": "2.0.1",
66
"pluginAPIVersion": 0,
77
"requires": {"backend": 0, "debugAdapters": 0, "languages": 0, "languageServers": 0, "pluginFunctions": 0, "settings": 0, "projectGenerators": 0, "toolDefinitions": 0, "sourceSettings": 0},
88
"requiresTools": ["java"],
@@ -126,6 +126,96 @@
126126
"platforms": [
127127
"macos"
128128
]
129+
},
130+
{
131+
"root": {
132+
"kind": "absolute",
133+
"path": "C:\\Program Files\\Java"
134+
},
135+
"pattern": "*",
136+
"platforms": [
137+
"windows"
138+
]
139+
},
140+
{
141+
"root": {
142+
"kind": "absolute",
143+
"path": "C:\\Program Files\\Eclipse Adoptium"
144+
},
145+
"pattern": "*",
146+
"platforms": [
147+
"windows"
148+
]
149+
},
150+
{
151+
"root": {
152+
"kind": "absolute",
153+
"path": "C:\\Program Files\\Microsoft"
154+
},
155+
"pattern": "jdk-*",
156+
"platforms": [
157+
"windows"
158+
]
159+
},
160+
{
161+
"root": {
162+
"kind": "absolute",
163+
"path": "C:\\Program Files\\Zulu"
164+
},
165+
"pattern": "*",
166+
"platforms": [
167+
"windows"
168+
]
169+
},
170+
{
171+
"root": {
172+
"kind": "absolute",
173+
"path": "C:\\Program Files\\Amazon Corretto"
174+
},
175+
"pattern": "*",
176+
"platforms": [
177+
"windows"
178+
]
179+
},
180+
{
181+
"root": {
182+
"kind": "absolute",
183+
"path": "C:\\Program Files\\BellSoft"
184+
},
185+
"pattern": "*",
186+
"platforms": [
187+
"windows"
188+
]
189+
},
190+
{
191+
"root": {
192+
"kind": "absolute",
193+
"path": "/usr/lib/jvm"
194+
},
195+
"pattern": "*",
196+
"platforms": [
197+
"linux"
198+
]
199+
},
200+
{
201+
"root": {
202+
"kind": "home"
203+
},
204+
"pattern": ".jdks/*",
205+
"platforms": [
206+
"windows",
207+
"linux"
208+
]
209+
},
210+
{
211+
"root": {
212+
"kind": "home"
213+
},
214+
"pattern": ".sdkman/candidates/java/*",
215+
"platforms": [
216+
"macos",
217+
"linux"
218+
]
129219
}
130220
],
131221
"homeVariable": "JAVA_HOME",

0 commit comments

Comments
 (0)