[PR #1214] [MERGED] Prepare with Minecraft's own Java 25 when no JDK is installed #3428

Closed
opened 2026-11-03 04:09:27 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: claude/upstream-mojang-java


📝 Commits (2)

  • 71edc9d Prepare with Minecraft's own Java 25 when no JDK is installed
  • 92d2e2b launcher: leave Java alone when the preparer finds one itself

📊 Changes

8 files changed (+411 additions, -29 deletions)

View changed files

📝 crates/horizon-prepare/src/java.rs (+88 -8)
📝 crates/horizon-prepare/src/lib.rs (+8 -1)
📝 crates/horizon-prepare/src/main.rs (+1 -0)
📝 launcher/src/backend.rs (+100 -18)
📝 launcher/src/mojang.rs (+116 -0)
📝 launcher/src/mojang_tests.rs (+96 -0)
📝 website/docs/install.md (+1 -1)
📝 website/docs/troubleshooting.md (+1 -1)

📄 Description

Requested by JR

What and why

Fixes #1217.

On a Mac with no JDK, Prepare failed with "Java 25 is needed … /usr/bin/javac -version printed no version: Unable to locate a Java Runtime". /usr/bin/javac is macOS's placeholder.

Mojang's Java runtimes are whole JDKs with javac (java-runtime-epsilon is 25.0.1 on every platform), and the official launcher has already downloaded one for anyone who played 26.3.

  • horizon-prepare: java::find now also tries Minecraft's runtimes (<game dir>/runtime/<component>/<platform>/<component>, jre.bundle/Contents/Home on macOS) and the launcher's pick (Options::java_home). Its error now names the macOS placeholder.
  • launcher: if no JDK turns up, it downloads the runtime the version JSON names (javaVersion.component) from Mojang into its own game folder. Every file is checked against its sha1, with executables and links laid out as the official launcher does it. A version's own preparer binary or Python script gets the JDK through JAVA_HOME and the PATH.
  • Install and troubleshooting docs no longer ask players to install Java.

Testing: the real Linux runtime was downloaded for a one-off check: 147 files, and its javac 25.0.1 compiled and ran a class with --release 25.

Vanilla reference

none (launcher and preparer tooling)

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on Mac, against upstream/main at 554932e9f, 1 min 23 s)

Check Result
Scope ✅ 8 files, +390 −29
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (5 s)
clippy ✅ (4 s)
tests: horizon-prepare ✅ 26 passed (1 s)
doc tests ✅ 0 passed
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (1 min 4 s)
launcher tests ✅ 96 passed (6 s)
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/1214 **Author:** [@pirut](https://github.com/pirut) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `claude/upstream-mojang-java` --- ### 📝 Commits (2) - [`71edc9d`](https://github.com/horizon-rust/horizon/commit/71edc9d41ce51c555f4c80b630a6e7c3f533d1b8) Prepare with Minecraft's own Java 25 when no JDK is installed - [`92d2e2b`](https://github.com/horizon-rust/horizon/commit/92d2e2b86daee54096cde44bc404c528e5e7af77) launcher: leave Java alone when the preparer finds one itself ### 📊 Changes **8 files changed** (+411 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-prepare/src/java.rs` (+88 -8) 📝 `crates/horizon-prepare/src/lib.rs` (+8 -1) 📝 `crates/horizon-prepare/src/main.rs` (+1 -0) 📝 `launcher/src/backend.rs` (+100 -18) 📝 `launcher/src/mojang.rs` (+116 -0) 📝 `launcher/src/mojang_tests.rs` (+96 -0) 📝 `website/docs/install.md` (+1 -1) 📝 `website/docs/troubleshooting.md` (+1 -1) </details> ### 📄 Description <!-- claude-projects-attribution: {"github_login":"pirut"} --> _Requested by **JR**_ ## What and why Fixes #1217. On a Mac with no JDK, Prepare failed with "Java 25 is needed … /usr/bin/javac -version printed no version: Unable to locate a Java Runtime". `/usr/bin/javac` is macOS's placeholder. Mojang's Java runtimes are whole JDKs with javac (`java-runtime-epsilon` is 25.0.1 on every platform), and the official launcher has already downloaded one for anyone who played 26.3. - **horizon-prepare**: `java::find` now also tries Minecraft's runtimes (`<game dir>/runtime/<component>/<platform>/<component>`, `jre.bundle/Contents/Home` on macOS) and the launcher's pick (`Options::java_home`). Its error now names the macOS placeholder. - **launcher**: if no JDK turns up, it downloads the runtime the version JSON names (`javaVersion.component`) from Mojang into its own game folder. Every file is checked against its sha1, with executables and links laid out as the official launcher does it. A version's own preparer binary or Python script gets the JDK through `JAVA_HOME` and the `PATH`. - Install and troubleshooting docs no longer ask players to install Java. Testing: the real Linux runtime was downloaded for a one-off check: 147 files, and its javac 25.0.1 compiled and ran a class with `--release 25`. ## Vanilla reference none (launcher and preparer tooling) ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on Mac, against upstream/main at 554932e9f, 1 min 23 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +390 −29 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (5 s) | | clippy | ✅ (4 s) | | tests: horizon-prepare | ✅ 26 passed (1 s) | | doc tests | ✅ 0 passed | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (1 min 4 s) | | launcher tests | ✅ 96 passed (6 s) | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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-03 04:09:27 +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#3428
No description provided.