Skip to content

[improve][build] Allow building with Java 26 - #26461

Merged
merlimat merged 1 commit into
apache:masterfrom
merlimat:mmerli/java-26-build
Sep 5, 2026
Merged

merlimat merged 1 commit into
apache:masterfrom
merlimat:mmerli/java-26-build

Conversation

@merlimat

@merlimat merlimat commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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. 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 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.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Verified locally:

  • ./gradlew sanityCheck passes on JDK 26.0.1 (all spotless/checkstyle tasks executed fresh on the 26 JVM, not from cache).
  • ./gradlew help succeeds 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.TopicNameTest runs on the JDK 26 JVM (18 tests, 0 failures), exercising the Java 24+ --enable-native-access test JVM flag.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

### 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)
@merlimat
merlimat requested a review from lhotari September 4, 2026 16:29
@merlimat
merlimat marked this pull request as ready for review September 4, 2026 18:17
@merlimat
merlimat merged commit 67205b9 into apache:master Sep 5, 2026
59 of 64 checks passed
@lhotari lhotari added this to the 5.0.0-M2 milestone Sep 12, 2026
Radiancebobo pushed a commit to Radiancebobo/pulsar that referenced this pull request Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants