Hi,

I'd like to propose enforcing JDK 21 as the minimum build JDK for Apache
Camel (both main and camel-4.18.x), while keeping the bytecode target at
Java 17. This means that anyone wanting to build Camel, will need to have
JDK21 (or 25) on their machine.

camel-util uses multi-release JARs to provide virtual thread support. The
java-21-sources Maven profile activates only when the build JDK is 21+
(<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 that never use virtual threads, with no warning.

Today this works because the release was built with JDK 21 (Build-Jdk-Spec:
21 in the 4.19.0 MANIFEST), but Jenkinsfile.deploy defaults to
jdk_17_latest (daily SNAPSHOT were released without VirtualThread support)
and nothing enforces the build JDK.

Moreover, main has a java-25-sources profile (<jdk>[25,)</jdk>) for
ScopedValue support.
To fully compile everything on main, JDK 25 would be needed. However, I
think that requiring JDK 25 to build Camel may cause friction for
contributors and users building from source. For now I'm proposing JDK 21
as the minimum (which covers virtual threads), but does anyone have a
strong opinion about requiring JDK 25 instead to include the ScopedValue?

main draft PR <https://github.com/apache/camel/pull/22608>
camel-4.18.x draft PR <https://github.com/apache/camel/pull/22609>

Regards,
Federico

Reply via email to