JDK 24 · JSR 399

Java 24

JDK 24 is Java SE 24, JSR 399, generally available on 18 March 2025. Stream gatherers and the class-file API become permanent. The Security Manager is permanently disabled. Scoped values, structured concurrency, primitive patterns, module imports, and flexible constructor bodies are still previews. Generational Shenandoah and compact object headers are experimental.

How to read the status

Language

Primitive Types in Patterns, instanceof, and switch (Second Preview)

JEP 488 · Preview · Language

Primitive patterns are previewed a second time.

Third preview in Java 25 (JEP 507). Not final.

OpenJDK JEP 488 (leaves JavaMastery)

Flexible Constructor Bodies (Third Preview)

JEP 492 · Preview · Language

Statements before super(...) are previewed a third time.

Final in Java 25 (JEP 513).

OpenJDK JEP 492 (leaves JavaMastery)

Simple Source Files and Instance Main Methods (Fourth Preview)

JEP 495 · Preview · Language

The compact-program preview continues under the name simple source files.

Final in Java 25 as compact source files (JEP 512).

OpenJDK JEP 495 (leaves JavaMastery)

APIs / Libraries

Class-File API

JEP 484 · Final · APIs / Libraries

The class-file API is a standard way to parse, generate, and transform class files.

Preview in Java 22 (JEP 457) and Java 23 (JEP 466).

OpenJDK JEP 484 (leaves JavaMastery)

Permanently Disable the Security Manager

JEP 486 · Final · APIs / Libraries

The Security Manager cannot be enabled. The API remains deprecated for removal.

Deprecated for removal in Java 17 (JEP 411).

OpenJDK JEP 486 (leaves JavaMastery)

Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism

JEP 496 · Final · APIs / Libraries

The JDK implements ML-KEM, a module-lattice key encapsulation mechanism.

OpenJDK JEP 496 (leaves JavaMastery)

Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm

JEP 497 · Final · APIs / Libraries

The JDK implements ML-DSA, a module-lattice signature algorithm.

OpenJDK JEP 497 (leaves JavaMastery)

Key Derivation Function API (Preview)

JEP 478 · Preview · APIs / Libraries

A preview API derives keys from key material. It is not final.

Final in Java 25 (JEP 510).

OpenJDK JEP 478 (leaves JavaMastery)

Structured Concurrency (Fourth Preview)

JEP 499 · Preview · APIs / Libraries

Structured concurrency is previewed a fourth time.

Fifth preview in Java 25 (JEP 505). It is not final.

OpenJDK JEP 499 (leaves JavaMastery)

Related reading: Concurrency

JVM / Runtime

Synchronize Virtual Threads without Pinning

JEP 491 · Final · JVM / Runtime

A virtual thread that enters a synchronized method or block can unmount from its carrier. This removes a reason virtual threads stayed pinned.

Virtual threads themselves were finalized in Java 21 (JEP 444).

OpenJDK JEP 491 (leaves JavaMastery)

Related reading: Concurrency

ZGC: Remove the Non-Generational Mode

JEP 490 · Final · JVM / Runtime

ZGC’s non-generational mode is removed. Generational ZGC remains.

Generational mode became the default in Java 23 (JEP 474).

OpenJDK JEP 490 (leaves JavaMastery)

Related reading: JVM and memory

Ahead-of-Time Class Loading & Linking

JEP 483 · Final · JVM / Runtime

An application can load and link classes from a cache created in a training run, so startup does less of that work.

Java 25 simplifies the command line for creating that cache (JEP 514).

OpenJDK JEP 483 (leaves JavaMastery)

Generational Shenandoah (Experimental)

JEP 404 · Experimental · JVM / Runtime

Shenandoah’s generational mode is experimental. The default Shenandoah mode stays single-generation.

It becomes a product feature in Java 25 (JEP 521) and is still not the default mode.

OpenJDK JEP 404 (leaves JavaMastery)

Related reading: JVM and memory

Compact Object Headers (Experimental)

JEP 450 · Experimental · JVM / Runtime

Compact object headers are an experimental layout. They are not the default.

They become a product feature in Java 25 (JEP 519) and are still not the default layout.

OpenJDK JEP 450 (leaves JavaMastery)

Also in this release: removal of the Windows 32-bit x86 port (JEP 479), warnings on Unsafe memory access (JEP 498), and deprecation of the 32-bit x86 port for removal (JEP 501).

Examples

  • versions8Java24Gatherers.javaJava 24 example · Requires Java 24Gatherers.windowFixed on a stream. Final in Java 24. The previews were Java 22 and Java 23.

Related reading

Historical notes

Features that are still previews here stay previews on this page even when Java 25 finalizes them. Generational Shenandoah is experimental in this release, not a product feature yet.

Sources. General availability, JSR 399, and the JEP list: OpenJDK JDK 24. OpenJDK JDK 24 (leaves JavaMastery)

All versions