Liferay Announces Deprecation of JDK 11

Liferay released Liferay DXP 2024.Q1 this week, and in the corresponding release notes, you'll find the following nugget.

Just search for "Java JDK 11 Runtime" to find in the notes, but here's the text for it:

Support for Java JDK 11 is flagged for deprecation as of Q1.2024. As DXP continues to evolve as a platform to deliver powerful solutions, we are planning to release support for the latest Java LTS runtime environment (JDK 21) later this year. JDK 11 will remain supported while we prepare for this next evolution.

So, what is actually going on?

Liferay is actively working on updating the JDK to JDK-21. As with previous JDK updates, it is not always the Liferay source code that Liferay has to fix, it always comes down to the third party jars and other transitive dependencies that Liferay mostly has to worry about.

Additionally, to build Liferay using JDK-21, there will be updates to the developer tools necessary.

However, once you update the third party jars and dev tools, you shut down support for older versions of the JDK, including Java 11.

Although the announcement doesn't say it, this will cause significant ripples...

First and foremost, it will remove any app server from the compatibility matrix that cannot run under JDK-21. So all app servers are going to either be bumped to versions that support JDK-21 or they'll be dropped from the list (like WebSphere 9 was).

Updating third party jars will likely touch the major Liferay dependencies such as Spring, Hibernate, EhCache, Quartz, OpenSAML, ... For third party jars that Liferay needs but are dead projects, Liferay will likely end up creating a custom fork to have JDK-21 compatibility.

As mentioned, the developer toolchain will see updates for the Gradle plugins, but may also see changes necessary for CSS and other build-time artifacts, updates to Jenkins CI/CD processes for Liferay PaaS, etc.

For any customizations that you may have, you'll likely need to at least recompile them for JDK-21 and perhaps also need to update your third-party dependencies for JDK-21 compatibility. Note that if you're using Client Extensions (CX) for your customization aspects, you won't be forced to update those because they run in separate docker containers and can use whatever they want for implementation purposes. It's just those customizations deployed as OSGi jars or wars into Liferay that you'll need to worry about.

Later this year?

One important aspect to understand is the portion of the text that says "we are planning to release support for the latest Java LTS runtime environment (JDK 21) later this year."

Sounds kind of ambiguous, right? I mean, don't they know it's going to happen in Q3 or Q4 or something?

Well, that's really kind of a problem. See we don't know what we don't know, yeah? I mean, we do know that we have to update dependencies and code and build tools and whatnot, but we don't know how hard or how long it will take to get through that.

Plus it's not like there will be a code freeze while this work is going on, so there's that...

The plan, as far as I know, is to shoot for Q3, but it could get pushed to Q4 or even 2025 because of problems encountered during the whole process.

So "later this year" is all Liferay will commit to at this point, but when will ultimately depend upon whatever trials and tribulations we face trying to get there.

I can promise, however, that this will happen in conjunction with a quarterly release... You're not going to get a 2024.Q3 that would support both JDK-11 and JDK-21 at the same time, no it will be more of an "to upgrade to 2024.Q3, you must upgrade to JDK-21" sort of deals. But again it could align on Q3, it could align on Q4, or maybe it doesn't happen unti 2025?

We won't know that until we get closer...

What I Recommend

You might be asking yourself what this will mean for your Liferay installation.

Personally, I'd recommend taking the following steps:

1. If you're not using Tomcat, start making the change now. Liferay uses Tomcat in its bundles and docker containers, and even if JDK-21 requires an updated version of Tomcat, that's what Liferay will focus on. Any other application servers will be an afterthought and may not be tested as much as Tomcat. Moving to Tomcat for your application server will position you on the right platform for Liferay's JDK-21 changes.

2. If you have OSGi-based jar or war modules, start collecting details about your third party jar dependencies. Find out which versions you might need to update to for JDK-21 support and plan for upgrading those, or for dependencies without JDK-21 compatibility, develop a plan for either moving to a different dependency or refactoring to remove the dependency altogether.

3. If you are using a CI/CD process for your builds, start the research and planning for how you will be upgrading that to support using JDK-21 for builds.

4. Consider switching JDK vendors. If you're still using Oracle's JDK (I know you're out there, Oracle knows you're out there, and they may come looking for you), this may be an opportune time to switch out your JDK for a non-Oracle version. Personally I tend to favor Azul's Zulu JDKs, but any flavor is fine as long as it passes the Java TCK.

5. And probably the most important recommendation:

Start Planning Now!

Yes, that's right, start planning now. Only you know how long it would take to push a major platform change like this through your organization. Some of you will be kicking back saying "Oh, I can do this over a long weekend!", but those of you with more stringent SCM processes and approved software lists (including version details) and long update cycles, you folks should start your planning now.

We all now know this is coming, so if we start planning for this now, when it happens it will not be such a big shock to our organizations...

If you have any questions or want more info, drop a comment below or hit me up on the Liferay Community Slack channels.

Blogs

Dear David,

thanks for this information.

But I find it a bit strange that Java 11 is declared as deprecated (which I personally think is good), but we still have to work with Java 8 in the LXC SM environment, because any higher Java JDK is currently not supported yet.

Do you know when we can expect an update here?

Best Regards

Christoph

Christoph, the team is aware of this discrepancy and hope to address it soon.

JDK8 is not going to be removed (deprecated doesn't necessarily mean not supported), but as of this point in time its the only option for PaaS.

When I get more details about it, I'll update here.