BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News JDK 24 and JDK 25: What We Know So Far

JDK 24 and JDK 25: What We Know So Far

Listen to this article -  0:00

JDK 24, the third non-LTS release since JDK 21, has reached its first release candidate phase as declared by Mark Reinhold, chief architect, Java Platform Group at Oracle. The main-line source repository, forked to the JDK stabilization repository in early-December 2024 (Rampdown Phase One), defines the feature set for JDK 24. Critical bugs, such as regressions or serious functionality issues, may be addressed, but must be approved via the Fix-Request process. As per the release schedule, JDK 24 will be formally released on March 18, 2025.

The final set of 24 new features, in the form of JEPs, can be separated into five (5) categories: Core Java Library, Java Language Specification, Security Library, HotSpot and Java Tools.

Seven (7) of these new features are categorized under Core Java Library:

Four (4) of these new features are categorized under Java Language Specification:

Four (4) of these new features are categorized under Security Library:

Eight (8) of these new features are categorized under HotSpot:

And finally, one (1) of these new features is categorized under Java Tools:

We examine some of these new features and include where they fall under the auspices of the major Java projects - Amber, Loom, Panama, Valhalla and Leyden - designed to incubate a series of components for eventual inclusion in the JDK through a curated merge.

Project Amber

JEP 495, Simple Source Files and Instance Main Methods (Fourth Preview), proposes a fourth preview without change (except for a second name change), after three previous rounds of preview, namely: JEP 477, Implicitly Declared Classes and Instance Main Methods (Third Preview), delivered in JDK 23; JEP 463, Implicitly Declared Classes and Instance Main Methods (Second Preview), delivered in JDK 22; and JEP 445, Unnamed Classes and Instance Main Methods (Preview), delivered in JDK 21. This feature aims to "evolve the Java language so that students can write their first programs without needing to understand language features designed for large programs." This JEP moves forward the September 2022 blog post, Paving the on-ramp, by Brian Goetz, Java language architect at Oracle. Gavin Bierman, consulting member of technical staff at Oracle, has published the first draft of the specification document for review by the Java community. More details on JEP 445 may be found in this InfoQ news story.

Project Loom

Formerly known as Extent-Local Variables (Incubator), JEP 487, Scoped Values (Fourth Preview), proposes a fourth preview, with one change, in order to gain additional experience and feedback from one round of incubation and three rounds of preview, namely: JEP 481, Scoped Values (Third Preview), delivered in JDK 23; JEP 464, Scoped Values (Second Preview), delivered in JDK 22; JEP 446, Scoped Values (Preview), delivered in JDK 21; and JEP 429, Scoped Values (Incubator), delivered in JDK 20. This feature enables sharing of immutable data within and across threads. This is preferred to thread-local variables, especially when using large numbers of virtual threads. The only change from the previous preview is the removal of the callWhere() and runWhere() methods from the ScopedValue class that leaves the API fluent. The ability to use one or more bound scoped values is accomplished via the call() and run() methods defined in the ScopedValue.Carrier class.

Project Panama

After its review had concluded, JEP 489, Vector API (Ninth Incubator), proposed to incorporate enhancements in response to feedback from the previous eight rounds of incubation, namely: JEP 469, Vector API (Eighth Incubator), delivered in JDK 23; JEP 460, Vector API (Seventh Incubator), delivered in JDK 22; JEP 448, Vector API (Sixth Incubator), delivered in JDK 21; JEP 438, Vector API (Fifth Incubator), delivered in JDK 20; JEP 426, Vector API (Fourth Incubator), delivered in JDK 19; JEP 417, Vector API (Third Incubator), delivered in JDK 18; JEP 414, Vector API (Second Incubator), delivered in JDK 17; and JEP 338, Vector API (Incubator), delivered as an incubator module in JDK 16. Originally slated to be a re-incubation by reusing the original Incubator status, it was decided to keep enumerating. The Vector API will continue to incubate until the necessary features of Project Valhalla become available as preview features. At that time, the Vector API team will adapt the Vector API and its implementation to use them, and will promote the Vector API from Incubation to Preview.

Project Leyden

JEP 483, Ahead-of-Time Class Loading & Linking, proposes to "improve startup time by making the classes of an application instantly available, in a loaded and linked state, when the HotSpot Java Virtual Machine starts." This may be achieved by monitoring the application during one run and storing the loaded and linked forms of all classes in a cache for use in subsequent runs. This feature will lay a foundation for future improvements to both startup and warmup time.

Security Library

JEP 497, Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm, proposes to "enhance the security of Java applications by providing an implementation of the quantum-resistant Module-Lattice-Based Digital Signature Algorithm (ML-DSA)" as standardized by FIPS 204. This will be accomplished by implementing the Java KeyPairGenerator, Signature and KeyFactory classes.

HotSpot

JEP 450, Compact Object Headers (Experimental), inspired by Project Lilliput, proposes to "reduce the size of object headers in the HotSpot JVM from between 96 and 128 bits down to 64 bits on 64-bit architectures." This feature is disabled by default as it is considered experimental and may cause unintended consequences if enabled by a developer. More details on JEP 450 may be found in this InfoQ news story.

JEP 404, Generational Shenandoah (Experimental), proposes to provide an experimental generational mode, without breaking non-generational Shenandoah Garbage Collector, with the intent to make the generational mode the default in a future JDK release. Originally targeted for JDK 21, JEP 404 was officially removed from the final feature set due to the "risks identified during the review process and the lack of time available to perform the thorough review that such a large contribution of code requires." At the time, the Shenandoah team decided to target a future JDK release to "deliver the best Generational Shenandoah that they can."

JDK 25

Scheduled for a GA release in September 2025, there are no JEPs targeted for JDK 25 at this time. However, based on a number of JEP candidates and drafts, especially those that have been submitted, we can surmise which additional JEPs have the potential to be included in JDK 25.

In an email to the Java community, Gavin Bierman, consulting member of technical staff at Oracle, has announced his intention to finalize the so-called "on-ramp" feature from JEP 495, Simple Source Files and Instance Main Methods (Fourth Preview), with the release of JDK 25 in September 2025. As of yet, no drafts have been created, but we expect this to change soon.

JEP 502, Stable Values (Preview), formerly known as Computed Constants (Preview), introduces the concept of computed constants, defined as immutable value holders that are initialized, at most, once. This offers the performance and safety benefits of final fields, while offering greater flexibility as to the timing of initialization.

JEP Draft 8340343, Structured Concurrency (Fifth Preview), proposes a fifth preview, with several API changes, to gain more feedback from the previous four rounds of preview, namely: JEP 499, Structured Concurrency (Fourth Preview), to be delivered in the upcoming GA release of JDK 24; JEP 480, Structured Concurrency (Third Preview), delivered in JDK 23; JEP 462, Structured Concurrency (Second Preview), delivered in JDK 22; and JEP 453, Structured Concurrency (Preview), delivered in JDK 21. This feature simplifies concurrent programming by introducing structured concurrency to "treat groups of related tasks running in different threads as a single unit of work, thereby streamlining error handling and cancellation, improving reliability, and enhancing observability." One of the proposed API changes involves the StructuredTaskScope interface to be opened via static factory methods rather than public constructors.

JEP Draft 8326035, CDS Object Streaming, proposes to add an object archiving mechanism for Class-Data Sharing (CDS) in the Z Garbage Collector (ZGC) with a unified CDS object archiving format and loader. This feature will keep GC implementation details and policies separate from the CDS archived object streaming mechanism.

JEP Draft 8300911, PEM API (Preview), introduces an easy and intuitive API for encoding and decoding the Privacy-Enhanced Mail (PEM) format to describe value holders that can change, at most, once. This PEM format will be used for storing and sending cryptographic keys and certificates.

JEP Draft 8291976, Support HTTP/3 in the HttpClient, proposes to update JEP 321, HTTP Client, delivered in JDK 11, to support the HTTP/3 protocol. This will allow applications and libraries to interact with HTTP/3 servers and get the benefits of HTTP/3 with minimal code changes.

We anticipate that Oracle will start targeting JEPs for JDK 25 very soon.

About the Author

Rate this Article

Adoption
Style

BT