diff --git a/docs/releases/v2.0.1.md b/docs/releases/v2.0.1.md new file mode 100644 index 0000000..391f904 --- /dev/null +++ b/docs/releases/v2.0.1.md @@ -0,0 +1,27 @@ +# Java 2.0.1 + +## 中文 + +- 修复 Windows 和 Linux 上“新建项目”和工具链设置找不到已安装 JDK 的问题([1lck/Lithe-IDEA#2032](https://github.com/1lck/Lithe-IDEA/issues/2032))。此前插件只为 macOS 声明了 JDK 安装目录。现在新增以下扫描位置: + - Windows:`C:\Program Files` 下的 `Java`、`Eclipse Adoptium`、`Microsoft`(`jdk-*`)、`Zulu`、`Amazon Corretto`、`BellSoft` + - Linux:`/usr/lib/jvm` + - Windows 和 Linux:用户目录下的 `.jdks` + - macOS 和 Linux:SDKMAN 的 `~/.sdkman/candidates/java` + +### 兼容性 + +宿主要求与 2.0.0 相同,只新增了扫描规则,不改变已有设置。装在其他位置的 JDK(例如 `D:\Program Files\...`)仍然只能通过 PATH 或 `JAVA_HOME` 找到;要让这类 JDK 出现在选择器里,需要使用包含 [1lck/Lithe-IDEA#2040](https://github.com/1lck/Lithe-IDEA/pull/2040) 的桌面端版本。 + +--- + +## English + +- 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: + - Windows: `Java`, `Eclipse Adoptium`, `Microsoft` (`jdk-*`), `Zulu`, `Amazon Corretto` and `BellSoft` under `C:\Program Files` + - Linux: `/usr/lib/jvm` + - Windows and Linux: `.jdks` in the home directory + - macOS and Linux: SDKMAN's `~/.sdkman/candidates/java` + +### Compatibility + +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). diff --git a/io.github.lithe-idea.java-support/plugin.json b/io.github.lithe-idea.java-support/plugin.json index a00c20c..2b2785f 100644 --- a/io.github.lithe-idea.java-support/plugin.json +++ b/io.github.lithe-idea.java-support/plugin.json @@ -2,7 +2,7 @@ "schemaVersion": 0, "id": "io.github.lithe-idea.java-support", "displayName": "Java Support", - "version": "2.0.0", + "version": "2.0.1", "pluginAPIVersion": 0, "requires": {"backend": 0, "debugAdapters": 0, "languages": 0, "languageServers": 0, "pluginFunctions": 0, "settings": 0, "projectGenerators": 0, "toolDefinitions": 0, "sourceSettings": 0}, "requiresTools": ["java"], @@ -126,6 +126,96 @@ "platforms": [ "macos" ] + }, + { + "root": { + "kind": "absolute", + "path": "C:\\Program Files\\Java" + }, + "pattern": "*", + "platforms": [ + "windows" + ] + }, + { + "root": { + "kind": "absolute", + "path": "C:\\Program Files\\Eclipse Adoptium" + }, + "pattern": "*", + "platforms": [ + "windows" + ] + }, + { + "root": { + "kind": "absolute", + "path": "C:\\Program Files\\Microsoft" + }, + "pattern": "jdk-*", + "platforms": [ + "windows" + ] + }, + { + "root": { + "kind": "absolute", + "path": "C:\\Program Files\\Zulu" + }, + "pattern": "*", + "platforms": [ + "windows" + ] + }, + { + "root": { + "kind": "absolute", + "path": "C:\\Program Files\\Amazon Corretto" + }, + "pattern": "*", + "platforms": [ + "windows" + ] + }, + { + "root": { + "kind": "absolute", + "path": "C:\\Program Files\\BellSoft" + }, + "pattern": "*", + "platforms": [ + "windows" + ] + }, + { + "root": { + "kind": "absolute", + "path": "/usr/lib/jvm" + }, + "pattern": "*", + "platforms": [ + "linux" + ] + }, + { + "root": { + "kind": "home" + }, + "pattern": ".jdks/*", + "platforms": [ + "windows", + "linux" + ] + }, + { + "root": { + "kind": "home" + }, + "pattern": ".sdkman/candidates/java/*", + "platforms": [ + "macos", + "linux" + ] } ], "homeVariable": "JAVA_HOME",