Skip to content

Conversation

@amanthatdoescares
Copy link
Contributor

Adds extra fallbacks to locate a JDK when JAVA_HOME is not set.

In addition to existing behavior, the tool now:

  • Detects Java installed via SDKMAN
  • Falls back to java on PATH (resolving symlinks)

Tested on Linux (x86_64).

Fixes #393

@ktoso
Copy link
Collaborator

ktoso commented Dec 21, 2025

We have the same kind of logic in all Package.swift and they all need to get the same treatment. Sadly there’s no great way to share code with Package.swift so we’ll have to copy paste the code I fear 😢

Sadly we can't share code between package.swift files...
@ktoso
Copy link
Collaborator

ktoso commented Jan 5, 2026

I applied the change to all the other places, we sadly don't have a good way to share code between those Package.swift files...

The macOS Swift test CI will fail but I verified locally and it is OK -- we have some problem with CI infrastructure I'm debuggigng.

@ktoso ktoso merged commit 404e17a into swiftlang:main Jan 5, 2026
47 of 48 checks passed
@ktoso
Copy link
Collaborator

ktoso commented Jan 5, 2026

Thank you @amanthatdoescares !

Sorry it took a moment to review, needed a real offline holiday over xmas :)

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.

Improve locating JAVA_HOME to ask sdkman and other tools in addition to java_home

2 participants