mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 11:06:11 -10:00
perf_bench: compile the driver mod with JAVA_HOME's javac
The vanilla runs start `$JAVA_HOME/bin/java`, but the driver mod was built with whatever `javac` came first on PATH. With JAVA_HOME on a JDK 25 and an older default JDK on PATH (21 on Ubuntu 24.04, for example), `javac --release 25` fails with "release version 25 not supported" before any game starts. Use JAVA_HOME's javac when JAVA_HOME is set, as the java lookups below already do; without it, PATH is used as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UE3PMKbnTcxfBSeT5uQWCK
This commit is contained in:
1 parent
b7df7bd9e0
commit
de25583ee5
1 file changed
+2
-1
+2
-1
@@ -510,7 +510,8 @@ def build_bench_mod(jars):
|
||||
shutil.rmtree(classes, ignore_errors=True)
|
||||
classes.mkdir(parents=True)
|
||||
sources = sorted(map(str, (source / "java").rglob("*.java")))
|
||||
subprocess.run(["javac", "--release", "25", "-proc:none", "-encoding", "UTF-8", "-d", str(classes),
|
||||
javac = Path(os.environ["JAVA_HOME"]) / "bin/javac" if os.environ.get("JAVA_HOME") else "javac"
|
||||
subprocess.run([str(javac), "--release", "25", "-proc:none", "-encoding", "UTF-8", "-d", str(classes),
|
||||
"-classpath", os.pathsep.join(map(str, jars)), *sources], check=True)
|
||||
output = build / "horizon-bench.jar"
|
||||
with zipfile.ZipFile(output, "w", compression=zipfile.ZIP_DEFLATED) as archive:
|
||||
|
||||
Reference in new issue
Block a user