ci: add Java 25 to the JNI build-and-test matrix#7391
Open
LuciferYang wants to merge 1 commit into
Open
Conversation
1e26f1a to
56bfe96
Compare
Java 25 is the September 2025 LTS; add it alongside 11/17/21 so the JNI bindings are exercised on the current LTS. The build targets maven.compiler.release 11, so the newer JDK only affects the build/test runtime, not the emitted bytecode. spotless's google-java-format step cannot run on Java 25: gjf 1.22.0 calls a com.sun.tools.javac API (Log$DeferredDiagnosticHandler.getDiagnostics) whose signature changed in JDK 25, and no gjf release runs on JDK 25 without dropping JDK 11/17 support (gjf >= 1.34 supports 25 but requires JDK 21+ to run). So the format gate is skipped on the Java 25 job only -- it is JDK-independent and stays enforced on 11/17/21. spotless is also bound into the build lifecycle (validate phase), so the build passes -Dspotless.skip=true on 25 in addition to skipping the standalone step.
56bfe96 to
4162870
Compare
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.
Summary
Adds Java 25 (the September 2025 LTS) to the
build-and-test-javamatrix in.github/workflows/java.yml, so the JNI bindings are built and tested on the current LTS alongside 11/17/21. The build targetsmaven.compiler.release11, so the newer JDK only affects the build/test runtime, not the emitted bytecode.With spotless excluded on Java 25 (see below),
mvn install— the full build plus all JNI tests — passes cleanly on JDK 25, so the bindings themselves are JDK-25-ready.Why spotless is skipped on Java 25
The
spotless/google-java-formatformat gate cannot run on JDK 25, and bumping the formatter is not a viable alternative while 11/17 stay in the matrix:google-java-format1.22.0 (pinned via spotless) callscom.sun.tools.javac.util.Log$DeferredDiagnosticHandler.getDiagnostics(), whose signature changed in JDK 25 →NoSuchMethodError.UnsupportedClassVersionError. No gjf release runs on 11/17 and supports 25. (A trial bump 1.22 → 1.27 also reformatted 0 of 190 files, i.e. no formatting drift to gain.)Since the format check is JDK-independent and stays enforced on 11/17/21, Java 25 is excluded from it. spotless is also bound into the Maven build lifecycle (
validatephase), so it is skipped in two places on the 25 job:if: matrix.java-version != '25'mvn install -Dspotless.skip=true(via a matrix-conditioned arg)Test plan
Build and Test with Java 11 / 17 / 21 / 25all green in CI.