Skip to content

Improve default Java home location and add testing for JavaVirtualMachine.shared#9

Merged
ktoso merged 16 commits intoswiftlang:mainfrom
swift-android-sdk:jvm-testing
Mar 12, 2026
Merged

Improve default Java home location and add testing for JavaVirtualMachine.shared#9
ktoso merged 16 commits intoswiftlang:mainfrom
swift-android-sdk:jvm-testing

Conversation

@marcprux
Copy link
Contributor

This PR refactors the location of the fallback system Java home into a systemJavaHome() function, and adds a new JavaVirtualMachineTests with a test to try loading the JVM and performing a simple class lookup and method invocation.

We also add pre-installation of a JVM for various Linux CI runs in order to be able to execute the test. The test will be skipped, rather than failing, on systems where we don't currently pre-install a JVM (Windows, macOS) or on Android, where we don't yet support running tests within an apk.

Copy link
Collaborator

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice change, lgtm.

@ktoso ktoso merged commit f1f8285 into swiftlang:main Mar 12, 2026
49 of 51 checks passed
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.

2 participants