[PR #1093] [MERGED] Prepare finds installed JDKs; the launcher shows the preparation error up top #3042

Closed
opened 2026-11-02 16:01:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1093
Author: @ludovic111
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @ludovic111

Base: main ← Head: fix/prepare-finds-jdks


📝 Commits (1)

  • 1fdc003 Prepare: find installed JDKs; launcher shows the preparation error up top (#666)

📊 Changes

2 files changed (+130 additions, -3 deletions)

View changed files

📝 crates/horizon-prepare/src/java.rs (+126 -1)
📝 launcher/src/main.rs (+4 -2)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

"Prepare does nothing" with a Prism Launcher folder (#666, reported by @segalll and @johhnyjefferson34133, with @rdbtCVS helping). johhnyjefferson34133 found the cause: the launcher was showing "Java 25 is needed", but only at the foot of the page, out of sight until he enlarged the window; and he had Java 25 installed, with JAVA_HOME still naming an older JDK. He asked for a way to point Horizon at a Java folder.

How

  • horizon-prepare finds installed JDKs (java::find): after JAVA_HOME, the PATH and macOS's java_home (unchanged order), it looks one folder below where JDK installers and tools put them: Program Files\{Eclipse Adoptium, Java, Microsoft, Zulu, BellSoft, Amazon Corretto, Semeru, OpenJDK} on Windows, /usr/lib/jvm, /usr/java, /usr/local/lib/jvm on Linux, JavaVirtualMachines/*/Contents/Home on macOS, plus ~/.jdks (IntelliJ) and SDKMAN. Only folders with bin/javac count; JDKs named for the pinned major come first, then newest name first, and the first whose javac -version is new enough wins. So an installed Java 25 is found whatever JAVA_HOME says, with no setting to learn. A Java-folder setting stays possible later if a JDK lives somewhere else.
  • The launcher shows the preparation's progress and error right under the buttons, above the Resources / Minecraft folder rows, instead of below them.

Proof

Self-check (Mac mini):

cargo fmt --all --check; (cd launcher && cargo fmt --check)           OK
set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings            OK (exit 0)
set -o pipefail; cd launcher && cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings   OK (exit 0)
cargo test -p horizon-prepare --lib java    1 passed (new: installed_jdks_prefer_the_pinned_major: Temurin-style folders, a JRE without javac skipped, a macOS bundle's Contents/Home)

No screenshot of the moved notice: the Mac mini's session was locked while this was tested (CGSSessionScreenIsLocked = 1), so screencapture sees only the lock screen. The change only moves two existing page.child(...) calls above rows.
tools/parity.py --changed origin/main: horizon-prepare feeds every harness, so CI's parity job runs them; nothing in the harness path calls java::find differently when JAVA_HOME holds a JDK 25, as it does on the runners.

Needs Ludovic

Nothing.

Fixes #666 (its no-sound follow-up is the asset-index problem, #1091).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1093 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/prepare-finds-jdks` --- ### 📝 Commits (1) - [`1fdc003`](https://github.com/horizon-rust/horizon/commit/1fdc003d52df44803fe256ac19d156a199d65b83) Prepare: find installed JDKs; launcher shows the preparation error up top (#666) ### 📊 Changes **2 files changed** (+130 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-prepare/src/java.rs` (+126 -1) 📝 `launcher/src/main.rs` (+4 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What "Prepare does nothing" with a Prism Launcher folder (#666, reported by **@segalll** and **@johhnyjefferson34133**, with **@rdbtCVS** helping). johhnyjefferson34133 found the cause: the launcher was showing "Java 25 is needed", but only at the foot of the page, out of sight until he enlarged the window; and he had Java 25 installed, with `JAVA_HOME` still naming an older JDK. He asked for a way to point Horizon at a Java folder. ## How - **horizon-prepare finds installed JDKs** (`java::find`): after `JAVA_HOME`, the `PATH` and macOS's `java_home` (unchanged order), it looks one folder below where JDK installers and tools put them: `Program Files\{Eclipse Adoptium, Java, Microsoft, Zulu, BellSoft, Amazon Corretto, Semeru, OpenJDK}` on Windows, `/usr/lib/jvm`, `/usr/java`, `/usr/local/lib/jvm` on Linux, `JavaVirtualMachines/*/Contents/Home` on macOS, plus `~/.jdks` (IntelliJ) and SDKMAN. Only folders with `bin/javac` count; JDKs named for the pinned major come first, then newest name first, and the first whose `javac -version` is new enough wins. So an installed Java 25 is found whatever `JAVA_HOME` says, with no setting to learn. A Java-folder setting stays possible later if a JDK lives somewhere else. - **The launcher shows the preparation's progress and error right under the buttons**, above the Resources / Minecraft folder rows, instead of below them. ## Proof Self-check (Mac mini): ``` cargo fmt --all --check; (cd launcher && cargo fmt --check) OK set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings OK (exit 0) set -o pipefail; cd launcher && cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings OK (exit 0) cargo test -p horizon-prepare --lib java 1 passed (new: installed_jdks_prefer_the_pinned_major: Temurin-style folders, a JRE without javac skipped, a macOS bundle's Contents/Home) ``` No screenshot of the moved notice: the Mac mini's session was locked while this was tested (`CGSSessionScreenIsLocked` = 1), so `screencapture` sees only the lock screen. The change only moves two existing `page.child(...)` calls above `rows`. `tools/parity.py --changed origin/main`: horizon-prepare feeds every harness, so CI's parity job runs them; nothing in the harness path calls `java::find` differently when `JAVA_HOME` holds a JDK 25, as it does on the runners. ## Needs Ludovic Nothing. Fixes #666 (its no-sound follow-up is the asset-index problem, #1091). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:01:02 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3042
No description provided.