fix(spawn-local-jdk): recognize and launch Windows JDK homes#51
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JDKDetector.ofrejected any JDK home that lacked abin/javafile, which meant a staged Windows JDK -- one that ships onlybin/java.exe-- was silently rejected before itsreleasefile was ever read, so the foreign-platformOperatingSystem/Architecturetagging added in #50 was unreachable for the one case it was built for.This updates the
bin/javaexistence check to also acceptbin/java.exe, and updatesLocalJDKLauncher#getExecutableto build the launch command withbin/java.exeon Windows andbin/javaelsewhere, based onOperatingSystem.current(), so a detected Windows JDK can actually be launched rather than just recognized.It also adds
windows@...glob rules tojava.home.propertiesfor common Windows JDK install locations (Oracle, Zulu, Eclipse Adoptium, Microsoft Build of OpenJDK, Amazon Corretto, SDKMAN, Scoop, and GitHub Actions Windows runners).JDKHomeBasedPatternDetector#matchesOSalready supported thewindowsOS-pattern prefix, but the properties file had zero entries using it, sopaths()returned nothing on a native Windows host.