Skip to content

Add Java 25 to build matrix#294

Merged
sbesson merged 9 commits intoglencoesoftware:masterfrom
melissalinkert:java-25
Feb 18, 2026
Merged

Add Java 25 to build matrix#294
sbesson merged 9 commits intoglencoesoftware:masterfrom
melissalinkert:java-25

Conversation

@melissalinkert
Copy link
Member

Raised by @mabruce.

This is one approach to including Java 25 builds. Unfortunately, there is no Gradle version that can be run on both Java 8 and Java 25. See https://docs.gradle.org/current/userguide/compatibility.html. This PR as written keeps the existing Gradle wrapper, but separately downloads and installs 9.2.1 for the Java 25 build only. I feel like there must be some nicer way to do that, so other ideas welcome.

Compatibility with both Gradle 8.x.x and 9.x.x required a few adjustments to the build.gradle, but that doesn't seem to be a problem. It's probably worth double-checking build logs and artifacts though to make sure everything looks reasonable.

I'd imagine that whatever we settle on here can be applied to other repositories, so this is mostly a place to start the discussion and not necessarily something I expect to be merged as-is.

@melissalinkert melissalinkert added this to the 0.12.0 milestone Dec 10, 2025
@erindiel erindiel requested a review from mabruce January 7, 2026 16:08
Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

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

The proposed changes are consistent with the roadmap for the upcoming Java support across these libraries discussed recently i.e.:

  • Java 11 is the minimal runtime requirement
  • Java 17 is the minimal build requirement
  • Gradle 9.x can be used for compiling across all supported LTS versions

Testing the built artifacts with different local Java versions works as expected

sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % jenv local 1.8
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % ./bin/bioformats2raw test.fake test.zarr
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/glencoesoftware/bioformats2raw/Converter has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:621)
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % jenv local 11 
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % rm -r test.zarr
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % ./bin/bioformats2raw test.fake test.zarr
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % jenv local 17                           
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % rm -r test.zarr                         
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % ./bin/bioformats2raw test.fake test.zarr
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % jenv local 21                           
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % rm -r test.zarr                         
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % ./bin/bioformats2raw test.fake test.zarr
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % jenv local 25  
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % rm -r test.zarr                         
sbesson@Sebastien-GS-MacBook-Pro-2025 bioformats2raw-0.12.0-SNAPSHOT % ./bin/bioformats2raw test.fake test.zarr
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by nu.pattern.OpenCV$LocalLoader in an unnamed module (file:/Users/sbesson/Downloads/bioformats2raw-0.12.0-SNAPSHOT/lib/opencv-4.7.0-0.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

https://github.com/glencoesoftware/bioformats2raw?tab=readme-ov-file#requirements should also be updated to capture the new requirements.

Copy link
Member

@erindiel erindiel left a comment

Choose a reason for hiding this comment

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

Approving based on clarity of updated requirements in README and successful conversion in local Java 17 environment.

@sbesson sbesson merged commit 0d84438 into glencoesoftware:master Feb 18, 2026
4 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.

3 participants