Skip to content

fix: discover SDKMAN Java when starting the shell launcher - #6858

Open
mvanhorn wants to merge 1 commit into
HMCL-dev:mainfrom
mvanhorn:fix/4574-sdkman-bootstrap-java-discovery
Open

mvanhorn wants to merge 1 commit into
HMCL-dev:mainfrom
mvanhorn:fix/4574-sdkman-bootstrap-java-discovery

Conversation

@mvanhorn

Copy link
Copy Markdown

Add a Linux/macOS fallback directly to HMCLauncher.sh after the existing lookup branches and before the Java-not-found warning, resolving SDKMAN's selected candidates/java/current/bin/java from a nonempty SDKMAN_DIR or, when unset/empty, a nonempty HOME plus .sdkman. The reporter cannot start HMCL-3.6.18.297.sh on Ubuntu 25.04 after installing Java through SDKMAN, with both Dragonwell 21 and Liberica 25 reported affected.

Reproduce the missing branch on Linux with JAVA_HOME and HMCL_JAVA_HOME absent and a controlled PATH containing only the bootstrap's required non-Java utilities: a temporary .sdkman/candidates/java/current symlink targets an executable stub, and startup selects it successfully; establish that the existing script fails this scenario before the fix; Verify custom SDKMAN_DIR and SDKMAN_CANDIDATES_DIR roots, including spaces in the root and launcher filename; empty SDKMAN variables fall back appropriately, while an absent/empty HOME must never trigger a relative lookup in the working directory.

Closes #4574

@github-actions github-actions Bot added the 100+ label Sep 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this file? Is there any connection between bash and java🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this file? Is there any connection between bash and java🤔

看起来是 AI 生成的内容。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] HCML 识别不到已经安装的 Java,无法启动

3 participants