Skip to content

Enforce JDK 21+ as minimum build JDK for multi-release JAR support#22609

Merged
Croway merged 1 commit intoapache:camel-4.18.xfrom
Croway:enforce-jdk21-4.18.x
Apr 16, 2026
Merged

Enforce JDK 21+ as minimum build JDK for multi-release JAR support#22609
Croway merged 1 commit intoapache:camel-4.18.xfrom
Croway:enforce-jdk21-4.18.x

Conversation

@Croway
Copy link
Copy Markdown
Contributor

@Croway Croway commented Apr 14, 2026

Summary

  • Add requireJavaVersion [21,) to the existing enforce-java-version execution in maven-enforcer-plugin
  • Change Jenkinsfile.deploy default JDK from jdk_17_latest to jdk_21_latest
  • Update minimalJavaBuildVersion from ${jdk.version} (17) to 21

Motivation

camel-util uses multi-release JARs with a java-21-sources profile activated by <jdk>[21,)</jdk>. If Camel is built with JDK 17, the virtual thread classes under META-INF/versions/21/ are silently omitted — users running on JDK 21 would get JARs without virtual thread support.

Jenkinsfile.deploy defaults to jdk_17_latest, meaning daily SNAPSHOT deployments were built without virtual thread support.

This does not change the runtime requirement — Camel JARs remain Java 17 compatible. It only ensures the build JDK is high enough to compile the multi-release JAR layers.

The enforcer runs only when the full profile is active (not with -Dquickly), so fast local builds are unaffected. The Jenkinsfile.deploy fix ensures SNAPSHOT deployments use JDK 21.

Backport of #22608

Discussion thread: dev@camel.apache.org "[DISCUSS] Enforce JDK 21+ for building Camel"

@Croway Croway force-pushed the enforce-jdk21-4.18.x branch from d7f8b58 to f52de47 Compare April 14, 2026 11:46
@Croway Croway force-pushed the enforce-jdk21-4.18.x branch from f52de47 to 0817fa9 Compare April 14, 2026 12:05
@Croway Croway marked this pull request as ready for review April 15, 2026 11:36
@Croway Croway merged commit 7912666 into apache:camel-4.18.x Apr 16, 2026
3 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