Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/managed_runtimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub const JDTLS_ID: &str = "jdtls";
/// The Java feature release verified with the pinned JDT LS and extensions.
pub const JAVA_FEATURE: u64 = 25;
/// Version of the full Microsoft Build of OpenJDK installed when none qualifies.
pub const JDK_VERSION: &str = "25.0.5.0.2";
pub const JDK_VERSION: &str = "25.0.5+8";
/// The request does not match the plugin's declared dependency contract.
pub const INVALID_PARAMS: &str = "runtime.invalid_params";
/// An explicitly selected server is not the verified upstream distribution.
Expand Down
9 changes: 7 additions & 2 deletions backend/tests/repository_pins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ fn the_language_service_jdk_is_separate_from_the_project_jdk() {
#[test]
fn managed_dependencies_pin_all_six_platforms_and_bind_only_the_service_tool() {
let manifest = read_json(&format!("{PLUGIN_ID}/plugin.json"));
assert_eq!(manifest["requires"]["managedRuntimes"], 0);
assert_eq!(manifest["requires"]["managedRuntimes"], 1);
assert!(manifest["permissions"]
.as_array()
.unwrap()
Expand All @@ -282,7 +282,12 @@ fn managed_dependencies_pin_all_six_platforms_and_bind_only_the_service_tool() {
if dependency["id"] == "jdk" {
assert_eq!(dependency["tool"], SERVER_RUNTIME_TOOL);
assert_eq!(dependency["version"], JDK_VERSION);
assert_eq!(artifact["stripPrefix"], "jdk-25.0.5.0.2+1");
let expected_prefix = if artifact["os"] == "windows" && artifact["arch"] == "arm64" {
"jdk-25.0.5.0.2+1"
} else {
"jdk-25.0.5+8"
};
assert_eq!(artifact["stripPrefix"], expected_prefix);
let windows = artifact["os"] == "windows";
assert_eq!(artifact["archive"], if windows { "zip" } else { "tar.gz" });
assert_eq!(
Expand Down
4 changes: 2 additions & 2 deletions compiler-host.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"repository": "https://github.com/1lck/Lithe-IDEA",
"revision": "b46e26ad20f9d9dcca569afe3a894358b3a7a15b",
"coreRevision": "545ca11fb971795a9937f0f60bcc29afebe3b8be",
"revision": "d87f1142ae5d9b6196e324409730fba4aad27664",
"coreRevision": "9dea6aa6eaaf830c3568b647aa7daae5018b9727",
"package": "io.github.lithe-idea.java-support"
}
10 changes: 5 additions & 5 deletions contract.lock.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"repository": "https://github.com/Lithe-IDEA/Lithe-core-rust",
"commit": "7f1fc4becd0b4b415aa463abd0ea5e2810b3e964",
"commit": "9dea6aa6eaaf830c3568b647aa7daae5018b9727",
"schemas": [
{
"path": "plugin-manifest.schema.json",
"sha256": "b28a4874018cd89d49d7feda31c158a10ac1d7050891bc832be0bc5b649b5beb"
"sha256": "ab756a2dfa023bd2301f7e52cf5d0a9a5341d60ec3df9a106715ad604119415c"
},
{
"path": "native-ui.schema.json",
"sha256": "e85bafc4b52f82bada93ef1d850e91372597411a8587829e6b047703cde3ad81"
"path": "plugin-ui.schema.json",
"sha256": "40629cfba7649c102f9e2701d37f53f4fcf20bd192450be1ec56270657f09fc2"
},
{
"path": "plugin-l10n.schema.json",
"sha256": "71fb928257139ee970be3c9d41d6e5cde147a5f6b786a460f3279b6ebd8d52ed"
"sha256": "a6d07bfe0fae0760640cffe9f1ed76f6f42b2851f6c5e7c4ff6a4407af30e38e"
}
]
}
27 changes: 27 additions & 0 deletions docs/releases/v4.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Java 4.2.0

## 中文

为自动准备的完整 JDK 25 增加国内多镜像源自动择优与故障切换,显著提升国内环境安装 Java 插件时的下载速度。

### 新功能

- **JDK 25 多镜像源自动切换(`managedRuntimes` 1)**:将 macOS / Linux / Windows x64 的服务专用 JDK 25 切换为 Eclipse Temurin `25.0.5+8`,并同时声明官方源、南京大学镜像站(NJU)与清华大学镜像站(TUNA),配合宿主自动测速择优与失败/低速回退,仍严格校验固定 SHA-256。

### 兼容性

- **需要声明 `managedRuntimes` 1 与 `sourceSettings` 1 的 Lithe 宿主(Lithe Desktop 0.8.8 及以后版本)**。Lithe Desktop 0.8.7 继续使用 Java Support 4.1.0,更早版本继续使用 4.0.2。

---

## English

Adds multi-mirror automatic selection and failover for the managed JDK 25 download, significantly speeding up Java plugin installation in mainland China.

### New features

- **Managed JDK 25 mirror failover (`managedRuntimes` 1)**: switches the service JDK 25 for macOS, Linux and Windows x64 to Eclipse Temurin `25.0.5+8` with official Adoptium, NJU and Tsinghua TUNA mirrors. The host probes mirrors in parallel and automatically fails over on errors or low throughput while verifying the exact pinned SHA-256.

### Compatibility

- **Requires a Lithe host advertising `managedRuntimes` 1 and `sourceSettings` 1 (Lithe Desktop 0.8.8 or later)**. Lithe Desktop 0.8.7 keeps Java Support 4.1.0, and earlier versions keep 4.0.2.
56 changes: 38 additions & 18 deletions io.github.lithe-idea.java-support/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"schemaVersion": 0,
"id": "io.github.lithe-idea.java-support",
"displayName": "Java Support",
"version": "4.1.0",
"version": "4.2.0",
"pluginAPIVersion": 0,
"requires": {"backend": 0, "debugAdapters": 0, "languages": 0, "languageServers": 0, "pluginFunctions": 0, "settings": 0, "projectGenerators": 0, "toolDefinitions": 0, "sourceSettings": 1, "managedRuntimes": 0},
"requires": {"backend": 0, "debugAdapters": 0, "languages": 0, "languageServers": 0, "pluginFunctions": 0, "settings": 0, "projectGenerators": 0, "toolDefinitions": 0, "sourceSettings": 1, "managedRuntimes": 1},
"managedRuntimes": {
"resolve": {
"function": "java.resolveRuntimes",
Expand All @@ -13,46 +13,62 @@
"dependencies": [
{
"id": "jdk",
"version": "25.0.5.0.2",
"version": "25.0.5+8",
"tool": "jdtls-runtime",
"artifacts": [
{
"os": "linux",
"arch": "arm64",
"url": "https://download.visualstudio.microsoft.com/download/pr/14450a49-85cd-4a91-aae1-73533f29b50f/da3e0632472c574335f779d20fa96bda/microsoft-jdk-25.0.5.0.2-linux-aarch64.tar.gz",
"sha256": "c0551fe6c3ea5b3244b74a275562bff128ae96563b0e13303597ccba72d15fa5",
"url": "https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.5%2B8/OpenJDK25U-jdk_aarch64_linux_hotspot_25.0.5_8.tar.gz",
"mirrors": [
"https://mirror.nju.edu.cn/adoptium/25/jdk/aarch64/linux/OpenJDK25U-jdk_aarch64_linux_hotspot_25.0.5_8.tar.gz",
"https://mirrors.tuna.tsinghua.edu.cn/Adoptium/25/jdk/aarch64/linux/OpenJDK25U-jdk_aarch64_linux_hotspot_25.0.5_8.tar.gz"
],
"sha256": "bb5b2ded252f21c6090cf780b0a408ad0d83bbb557e702955643557f13231880",
"archive": "tar.gz",
"stripPrefix": "jdk-25.0.5.0.2+1",
"stripPrefix": "jdk-25.0.5+8",
"home": "",
"executable": "bin/java"
},
{
"os": "linux",
"arch": "x86_64",
"url": "https://download.visualstudio.microsoft.com/download/pr/14450a49-85cd-4a91-aae1-73533f29b50f/fc1ef3012ee520e0c6c9663e30c9dc34/microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz",
"sha256": "173e8e4286289335b422b591c88a1f553fc44c701a876a7c8dd29037a598fc14",
"url": "https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.5%2B8/OpenJDK25U-jdk_x64_linux_hotspot_25.0.5_8.tar.gz",
"mirrors": [
"https://mirror.nju.edu.cn/adoptium/25/jdk/x64/linux/OpenJDK25U-jdk_x64_linux_hotspot_25.0.5_8.tar.gz",
"https://mirrors.tuna.tsinghua.edu.cn/Adoptium/25/jdk/x64/linux/OpenJDK25U-jdk_x64_linux_hotspot_25.0.5_8.tar.gz"
],
"sha256": "68982529869257d0ee6b824ec5aa270ff8b118bb438670da0b97ebdab178d7fb",
"archive": "tar.gz",
"stripPrefix": "jdk-25.0.5.0.2+1",
"stripPrefix": "jdk-25.0.5+8",
"home": "",
"executable": "bin/java"
},
{
"os": "macos",
"arch": "arm64",
"url": "https://download.visualstudio.microsoft.com/download/pr/14450a49-85cd-4a91-aae1-73533f29b50f/9664b951f4e9f908d29d89bb749e453d/microsoft-jdk-25.0.5.0.2-macos-aarch64.tar.gz",
"sha256": "c9cf199844411c8bafd05722d2547538300523a63ff6207a440c71b175ff7873",
"url": "https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.5%2B8/OpenJDK25U-jdk_aarch64_mac_hotspot_25.0.5_8.tar.gz",
"mirrors": [
"https://mirror.nju.edu.cn/adoptium/25/jdk/aarch64/mac/OpenJDK25U-jdk_aarch64_mac_hotspot_25.0.5_8.tar.gz",
"https://mirrors.tuna.tsinghua.edu.cn/Adoptium/25/jdk/aarch64/mac/OpenJDK25U-jdk_aarch64_mac_hotspot_25.0.5_8.tar.gz"
],
"sha256": "36dc14d797aaff6d89aab302cd053fdba6207dfdcf772052fa7b023a94b0e857",
"archive": "tar.gz",
"stripPrefix": "jdk-25.0.5.0.2+1",
"stripPrefix": "jdk-25.0.5+8",
"home": "Contents/Home",
"executable": "bin/java"
},
{
"os": "macos",
"arch": "x86_64",
"url": "https://download.visualstudio.microsoft.com/download/pr/14450a49-85cd-4a91-aae1-73533f29b50f/146488b930fd4721e6553826415e3d50/microsoft-jdk-25.0.5.0.2-macos-x64.tar.gz",
"sha256": "e92259d25beacd96b6446edbf769f1d96beca706d486ddd34a25c9166befa05b",
"url": "https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.5%2B8/OpenJDK25U-jdk_x64_mac_hotspot_25.0.5_8.tar.gz",
"mirrors": [
"https://mirror.nju.edu.cn/adoptium/25/jdk/x64/mac/OpenJDK25U-jdk_x64_mac_hotspot_25.0.5_8.tar.gz",
"https://mirrors.tuna.tsinghua.edu.cn/Adoptium/25/jdk/x64/mac/OpenJDK25U-jdk_x64_mac_hotspot_25.0.5_8.tar.gz"
],
"sha256": "32cd4d2151c91aa00d0fc911edfd05245ed40fa6b1aa894d5f35c928cd67a59d",
"archive": "tar.gz",
"stripPrefix": "jdk-25.0.5.0.2+1",
"stripPrefix": "jdk-25.0.5+8",
"home": "Contents/Home",
"executable": "bin/java"
},
Expand All @@ -69,10 +85,14 @@
{
"os": "windows",
"arch": "x86_64",
"url": "https://download.visualstudio.microsoft.com/download/pr/d3500af4-89c2-41c0-9a46-fae21d52f60b/dbca35c699765b2a740ca73973a92715/microsoft-jdk-25.0.5.0.2-windows-x64.zip",
"sha256": "5da7525c8268a10a66bd76a39f4e9af24d4ebc974d42800a609852c498a68460",
"url": "https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.5%2B8/OpenJDK25U-jdk_x64_windows_hotspot_25.0.5_8.zip",
"mirrors": [
"https://mirror.nju.edu.cn/adoptium/25/jdk/x64/windows/OpenJDK25U-jdk_x64_windows_hotspot_25.0.5_8.zip",
"https://mirrors.tuna.tsinghua.edu.cn/Adoptium/25/jdk/x64/windows/OpenJDK25U-jdk_x64_windows_hotspot_25.0.5_8.zip"
],
"sha256": "636bdc13dc649ddc7d5921c5c7d23cca6e44fd19d662b45cc9c02135a6c96c42",
"archive": "zip",
"stripPrefix": "jdk-25.0.5.0.2+1",
"stripPrefix": "jdk-25.0.5+8",
"home": "",
"executable": "bin/java.exe"
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/verify-contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def main():
registry = Registry()
for record in lock["schemas"]:
name = record["path"]
assert name in {"plugin-manifest.schema.json", "native-ui.schema.json", "plugin-l10n.schema.json"}
assert name in {"plugin-manifest.schema.json", "native-ui.schema.json", "plugin-ui.schema.json", "plugin-l10n.schema.json"}
path = cache / name
if not path.exists():
if not args.download:
Expand Down
Loading