Repository navigation
[improve][build] Allow building with Java 26 - #26461
Merged
Merged
Conversation
### Motivation The Gradle build's JDK gate in `settings.gradle.kts` only accepts Java 21 or 25, so running `./gradlew` on a Java 26 JDK fails immediately unless `-PskipJavaVersionCheck` is passed. With the check skipped, the codebase already compiles cleanly on 26: `./gradlew sanityCheck` (checkstyle, spotless, Apache RAT, and main + test compilation of every module) passes, and unit tests run on the 26 JVM. ### Modifications - `settings.gradle.kts`: accept Java 26 in the JDK version check and update the error message and the `dockerJavaVersion` override comment. - `CONTRIBUTING.md`, `ARCHITECTURE.md`, `README.md`: document Java 26 as a supported build JDK for `master`. - `pulsar-ci.yaml`, `pulsar-ci-flaky.yaml`: add `26` as a `workflow_dispatch` choice for `jdk_major_version` so CI can be run on Java 26 on demand. Defaults, scheduled runs, and the shade matrix are unchanged. Assisted-by: Claude Code (Fable 5.1)
lhotari
approved these changes
Sep 5, 2026
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.
Motivation
The Gradle build's JDK gate in
settings.gradle.ktsonly accepts Java 21 or 25, so running./gradlewon a Java 26 JDK fails immediately unless-PskipJavaVersionCheckis passed. With the check skipped, the codebase already compiles cleanly on 26:./gradlew sanityCheck(checkstyle, spotless, Apache RAT, and main + test compilation of every module) passes, and unit tests run on the 26 JVM. No toolchain bumps (Gradle 9.7.1, Lombok, checkstyle, spotless) were needed.Modifications
settings.gradle.kts: accept Java 26 in the JDK version check; update the error message and thedockerJavaVersionoverride comment.CONTRIBUTING.md,ARCHITECTURE.md,README.md: document Java 26 as a supported build JDK formaster.pulsar-ci.yaml,pulsar-ci-flaky.yaml: add26as aworkflow_dispatchchoice forjdk_major_versionso CI can be run on Java 26 on demand. Defaults, scheduled runs, and the shade matrix are unchanged.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Verified locally:
./gradlew sanityCheckpasses on JDK 26.0.1 (all spotless/checkstyle tasks executed fresh on the 26 JVM, not from cache)../gradlew helpsucceeds on JDK 26 and JDK 21 without-PskipJavaVersionCheck; JDK 17 is still rejected with the updated message.:pulsar-common:test --tests org.apache.pulsar.common.naming.TopicNameTestruns on the JDK 26 JVM (18 tests, 0 failures), exercising the Java 24+--enable-native-accesstest JVM flag.Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes