AEM & Java 21

It’s 2026 and with it we start the year of Java 21 in AEM.

In 2025 we saw the migration of (almost) all customer of the AEM CS platform from a Java 11 runtime to Java 21. And on February 9th the support for any older runtime version will be officially removed, both from the instances in the cloud, but also for the SDK builds. That means that for your local development you will need to use Java 21 as a runtime as well.

And while the build environments *can* still run with Java 11 (or even Java 8), there is always the chance that updated build-time dependencies might pull in the need to update the build-time java version as well. While in most cases such an update works flawlessly, there are a few test frameworks which need updating; for example you might need to update your Mockito version (if you are still using 1.x that will be a bit of work! Did that on a few codebases…) and such.

But honestly, that’s all worth the benefits of using Java 21. Because it gives 2 main benefits:

  • The improved performance of Java 21 in the build process itself; my personal experience is that it can reduce the duration of build-time processe (especially for the unit-tests) to 50%, which is significant.
  • It unlocks the capabilities of the Java 21 language features; might be insignificant to many, but there are nice things included (records?)

The release notes also mention that some time in the future the support for a Java 8 and Java 11 build-time environment will be removed. So better be prepared for that and add the topic of “Updating build environmen to Java 21” to your backlog for 2026.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.