Skip to content

feat(spawn-jdk): tag JDK with target OperatingSystem and Architecture#50

Merged
deer merged 1 commit into
mainfrom
target_support
Jul 15, 2026
Merged

feat(spawn-jdk): tag JDK with target OperatingSystem and Architecture#50
deer merged 1 commit into
mainfrom
target_support

Conversation

@deer

@deer deer commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

JDK previously only tracked its JDKVersion and JDKHome, with no way to tell which platform a given installation was actually built for. This made it impossible to distinguish a foreign JDK -- for example one staged for cross-target jlinking -- from a JDK native to the host running detection.

This adds two new enums, OperatingSystem (LINUX, MAC, WINDOWS, OTHER) and Architecture (X86_64, AARCH64, OTHER), each with an of(String) parser for common naming variants and a current() factory sourced from the os.name/os.arch system properties. JDK now carries an operatingSystem() and architecture() alongside its version and home, with equals()/hashCode()/toString() updated to match; the existing of(version, home) and current() factories keep working by defaulting to the host's current platform.

JDKDetector.of(Path) now reads the OS_NAME/OS_ARCH entries from a JDK's release file to tag it with the platform it was built for, falling back to the host's current platform when those entries are absent, preserving prior behavior. A new default method, JDKDetector.detect(OperatingSystem, Architecture), filters the detected JDKs down to a specific target platform.

@deer
deer merged commit 95d0a70 into main Jul 15, 2026
1 check passed
@deer
deer deleted the target_support branch July 15, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant