Looking at Java 22: Intro

 ยท 5 min
AI-generated by DALL-E

Java 22 is just around the corner (GA 2024-03-19), so it’s time to look at (most of the) included goodies, much like we did with the previous version.

This time around, the new version includes 12 JEPs in total, with 7 being previews and a single incubator one.

First, though, I want to talk a little bit about how Java versions work in general.


The Evolution of Java’s Release Strategy

Since Java 10, each release has included between 5 and 17 Java Enhancement Proposals (JEPs), a noticeable decrease from Java 8’s 56 JEPs and Java 9’s whooping 91!

However, keep in mind that the timeframes between the releases differ immensely. The transition from Java 7 to 8 took 32 months, and moving on from Java 8 to 9 spanned over 42 months.

However, starting with Java 9, the release cadence shifted to a consistent six-month period, with a new Java version arriving each March and September.

Instead of waiting years for a plethora of new features, fixes, and security enhancements, the predictable release cycle guarantees a constant stream of new goodies by prioritizing the release dates over the number of finished JEPs.

Of course, a fixed release schedule impacts when a certain feature might get released. The best example of this is how “Long-Term-Support” (LTS) versions have changed over the years.

Previously, up to Java 11, LTS versions were comprised solely of finalized JEPs and were significantly more substantial than their non-LTS counterparts. Java 9 was the odd man out, as it was quite massive with lots of possibly breaking changes like the module system, and it wasn’t even an LTS release.

However, after Java 11, LTS versions adopted a fixed release cadence coupled with the non-LTS one. Initially set at every 36 months, the interval was later reduced to every 24 months following LTS Java 17. That means the next LTS Java version is 25, which will be released in September 2025.

In addition to reducing the gap between LTS releases, the included JEPs also changed. Where 8 and 11 didn’t include any preview or incubator features, Java 17 started including those again.

For instance, the current LTS, Java 21, included 6 previews and 1 incubating JEP. Given that previews and incubator features are always opt-in, it doesn’t make much sense to exclude them and push them out an additional 6 months until the next non-LTS release.

Releasing JEPs earlier allows for experimentation and we can give feedback to shape their final form based on real-world usage. This approach allows Java to progress steadily and predictably, embodying a philosophy of “thoughtful evolution”: balancing innovation with a strong commitment to backward compatibility.

Java’s strategy often results in a “last-mover advantage,” learning from the experiences of other languages to address challenges effectively without the initial trial and error or the need for makeshift fixes. Consequently, Java’s features are typically well-conceived and align with the established Java ecosystem.

However, this cautious approach means that Java may not immediately adopt the latest, most hyped features. Yet, this also spares us from disruptions thanks to a “move fast and break things” mentality, enhancing our developer experience.

This balance between innovation and stability is, in my view, one of Java’s greatest strengths and a key reason why I love it so much.


Java 22

Within the OpenJDK, projects are defined as “collaborative efforts to produce a specific artifact”. Such an artifact could range from a set of new features to documentation, or any other type of material, even a new Java version.

These projects help to organize JEPs according to the areas of the JDK they might affect.

Nevertheless, not every JEP is associated with a distinct project. Four JEPs are categorized more broadly, not fitting into any specific project.

Project Amber

Productivity-oriented language features

Project Loom

Easy-to-use, high-throughput, and lightweight concurrency

  • Structured Concurrency (JEP 462) 2nd Preview
  • Scoped Values (JEP 464) 2nd Preview

Project Panama

Interconnecting the JVM and native code

Core Libraries and Tools

Performance Updates


While Java 22 may not boast as many JEPs as its predecessor, I still find plenty to be excited about in this release. Personally, I’m really looking forward to the Project Amber changes and the Stream Gatherers preview.

As with the previous release, my plan is to publish a series of brief articles, each dedicated to discussing a single JEP. It’s unlikely, though, that I’ll cover all 12, as my focus will be on the features I find most interesting and impactful for my work.

However, if you’re interested in an article about more niche topics, such as Project Panama or the modifications to the G1 garbage collector, just let me know!


A Functional Approach to Java Cover Image
Interested in using functional concepts and techniques in your Java code?
Check out my book!
Available in English, Polish, and soon, Chinese.

Resources

Looking at Java 22