sbt/launcher-package
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
..
bin fix typo 2025-01-02 13:52:51 +09:00
citest [2.x] ci: Build sbt/sbt using sbt 2 (#9244) 2026-07-20 12:38:53 -04:00
citest2 [2.x] test: Update sbt.version in launcher-package/citest2 (#9357) 2026-06-19 22:11:30 -04:00
integration-test [2.x] fix: Honor -java-home in the Windows launchers (#9434) 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
upload Spelling (#8028) 2025-02-04 01:11:28 -05:00
CONTRIBUTING.md move to launcher-package/ 2021-04-19 10:45:29 -04:00
LICENSE ci: Split server-test 2025-08-24 00:17:58 -04:00
NOTICE Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
build.sbt [2.x] ci: Build sbt/sbt using sbt 2 (#9244) 2026-07-20 12:38:53 -04:00