sbt/sbtw
Jozef Koval 5da646f977
[2.x] fix: Honor -java-home in the Windows launchers (#9434)
**Problem**

-java-home wasn't fully honored on Windows: sbtw rejected the single-dash form, silently ignored bad paths, and didn't propagate the JDK to the sbt/sbtn child; sbt.bat didn't fix up PATH/JAVACMD, and a project .java-version could override an explicit -java-home. Residual #963 gaps (the original javac-from-PATH bug was fixed long ago).

**Solution**

New SelectedJava seam in sbtw resolves the JDK once (--java-home > JAVACMD > JAVA_HOME > PATH) and applies one env overlay on every launch path; sbt.bat's handler now sets PATH/JAVACMD and a one-hop marker so .java-version defers to an explicit -java-home.

JDK_HOME > JAVA_HOME (the issue's "even more desired" ordering) is intentionally **not** implemented — it only mattered when JAVA_HOME pointed at a JRE without javac, and JDK 17+ (required by sbt 2.x) no longer ships standalone JREs, so JAVA_HOME always resolves to a full JDK.
2026-08-13 13:52:46 -04:00
..
src [2.x] fix: Honor -java-home in the Windows launchers (#9434) 2026-08-13 13:52:46 -04:00
build.sbt [2.x] feat: sbtw launcher (#8742) 2026-02-16 16:21:30 -05:00