Repository navigation
feat!: 使用用户自装的 JDT LS,插件包不再附带语言服务器和 JDK - #18
Merged
Merged
Conversation
Java Support no longer ships Eclipse JDT LS or a JDK. The backend now locates the user's JDT LS installation (setting, JDTLS_HOME, jdtls on PATH, Homebrew/Linuxbrew/mason/Scoop, VS Code redhat.java) and answers the launch with the new jdtls-runtime tool, refusing a JDK older than 21. The package keeps only Lombok, java-debug and java-test extensions, shrinking from ~250 MiB to ~11 MiB. The JDT decompiler patch is dropped. BREAKING CHANGE: users must install JDT LS and a JDK 21+ themselves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setup-java v4 is deprecated and no longer receives updates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1lck
marked this pull request as ready for review
November 16, 2026 14:27
This was referenced Nov 16, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue:无(用户直接提出:参考 Go 插件,把 JDT LS 从 Java 插件里拆出来);契约缺口跟进:1lck/Lithe-IDEA#2057
类型:feat(不兼容变更,版本 2.0.x → 3.0.0)
为什么
插件市场下载 Java Support 2.0.0 需要 251.7 MiB,绝大部分是随包附带的 JDT LS 和 JDK。Go 插件用的是用户自己装的
gopls,Java 插件改成同样的模式:用户自己装 JDT LS,插件只带自己加给 JDT LS 的扩展。macOS arm64 包现在 11.85 MB(11,852,392 字节)。改动
后端
backend/src/jdtls.rs:按顺序查找 JDT LS,用第一个找到的:languageServerHome(设置 → Java →「语言服务器目录」);设了就只用它,目录不对返回launch.server_invalid,不回退到别的安装;JDTLS_HOME;PATH上的jdtls/jdtls.bat/jdtls.cmd(解析符号链接,取<安装>/bin/jdtls的安装根);/opt/homebrew/opt/jdtls、/usr/local/opt/jdtls)、Linuxbrew、mason.nvim(macOS/Linux/Windows)、Scoop;.vscode、.vscode-insiders、.vscode-oss、.cursor)的redhat.java-*/server,新版本优先。libexec/下恰好一个plugins/org.eclipse.equinox.launcher_*.jar,并有当前平台的config_<mac_arm|mac|linux_arm|linux|win>/config.ini。都找不到返回launch.server_missing,错误信息写明安装方式和设置入口。backend/src/launch.rs:启动答复改为executable: {kind: "tool", tool: "jdtls-runtime"};读取tools["jdtls-runtime"].version,低于 21 返回新错误码launch.runtime_too_old。Equinox 配置仍复制到宿主给的stateDirectory,用户的 JDT LS 安装和插件包都不写。包内布局常量改为jdtls-extensions/…,删除 runtime/launcher/configuration 相关常量。backend/tests/repository_pins.rs:测试跟随新布局,新增“用户的 JDT LS 用声明的运行时工具启动”测试。Manifest(
plugin.json/l10n/zh-Hans.json)requiresTools: ["java", "jdtls-runtime"]。jdtls-runtime(「JDK for JDT LS」),在工具链设置里单独选择,和项目用的「JDK」(java)互不影响,项目仍可用 Java 8 等旧版本。java工具的发现新增 Homebrewopenjdk*(macOS、Linuxbrew)。languageServerHome;补齐heapMaxMB、logLevel和「语言服务器」分节的中文。打包与 CI
scripts/assemble-package.sh、build-linux.mjs、build-windows.mjs、linux-runtime.mjs:只打包 Lombok、java-debug、java-test 和它们的许可与锁定清单,不再打包 JDK、JDT LS。scripts/verify-package.sh:只允许预期的顶层条目,发现打包了 launcher、java、libjvm、config_*直接失败。scripts/prepare-jdtls.sh:去掉 JDK 检查;仍下载并校验已测试的 JDT LS 1.61.0,供扩展兼容测试使用。third_party/jdk/、scripts/prepare-jdk.sh、JDT 反编译器补丁(third_party/jdtls/patches/、scripts/package/patch-jdt-decompiler*.mjs)。scripts/package/jdtls-test-inputs.mjs(LITHE_TEST_JDTLS_HOME、LITHE_TEST_JDTLS_JAVA);smoke-linux.mjs、scripts/compiler/test-live.mjs用外部 JDT LS 跑(另加LITHE_TEST_PROJECT_JAVA_HOME,并修正 win32→windows 的平台名)。.artifacts/jdtls-downloads;macOS 打包任务和 Linux 任务加actions/setup-java@v4(Temurin 21)给 JDT LS 用。文档
README(新增「语言服务器与 JDK」)、NOTICE、
third_party/README.md、docs/linux-packaging.md、docs/feature-matrix.md(3.0.0 节)、MIGRATION.md、launch_resources.rs文档注释,新增发布说明docs/releases/v3.0.0.md(中英,含不兼容变更)。已知限制
systemCommand启动提供commandInstallers,后端启动用不了,用户需按错误提示自己装(brew install jdtls等)。已提 [Feature] 后端启动的语言服务器也能声明一键安装器和工具最低版本(Java 插件改用用户自装 JDT LS 后的契约缺口) 1lck/Lithe-IDEA#2057。minimumVersion,宿主自动选择不会跳过低于 21 的 JDK;PATH上是 JDK 17 时会报launch.runtime_too_old,需在工具链里为「JDK for JDT LS」选 21+。同在 #2057。验证(macOS arm64 本机)
cargo fmt --check、cargo clippy --workspace --all-targets --locked -- -D warnings、cargo test --workspace --locked全部通过;node --test scripts/package/*.test.mjs6 项通过。validate_manifest_value与设置状态命令校验plugin.json和zh-Hans.json:manifest 有效,中文全部生效,无拒绝项。scripts/build-package.sh --arch arm64打包 +verify-package.sh通过:Lithe-Java-Support-3.0.0-darwin-arm64.zip11,852,392 字节。scripts/compiler/test-live.mjs(真实 JDT LS 编译、构建工作区):JDT LS 1.61.0 与 Homebrew 1.60.0 在 JDK 21 上,unmanaged 与 Eclipse 项目都通过;JDT LS 跑在 JDK 26、项目 JDK 21 也通过。跑完确认插件包和 JDT LS 安装目录没有被写入。launch.server_invalid;运行时 JDK 17 返回launch.runtime_too_old。actions/setup-java用 v5(v4 已弃用)。build-package.sh --arch x86_64+ 归档 + 校验通过,Lithe-Java-Support-3.0.0-darwin-x64.zip11,972,417 字节;按 CI 原样(只设 JDK 21、不传测试变量)跑test-live.mjs的 unmanaged 和 eclipse 两种项目都通过。x86_64-pc-windows-gnu;发版工作流用 msvc):cargo test --workspace --locked全部通过;来宾里编译后端、Mac 上build-windows.mjs组包(13.3 MB),来宾里按smoke-linux.mjs的 Windows 改写版解压安装包,用 Temurin 21 真实启动 JDT LS 1.61.0:握手、resolveLaunch(config_win)、initialize/shutdown 通过,插件包和 JDT LS 安装目录不变。Windows 改写版冒烟脚本只用于本次验证,没有提交。libc只在 Unix 用却声明为通用依赖,Rust 1.100 报 unused dependency,已建单 backend: libc 只在 Unix 使用,应移到 cfg(unix) 依赖,Windows 编译报 unused dependency #19(feat(java): native compiler targets and local JAR settings #16 引入,不在本 PR 改)。合入后
发布 v3.0.0(release 工作流)并更新 Lithe Store 索引。
🤖 Generated with Claude Code