JDK 23 · JSR 398

Java 23

JDK 23 is Java SE 23, JSR 398, generally available on 17 September 2024. Markdown documentation comments become standard. Primitive patterns, module import declarations, and flexible constructor bodies are previews. ZGC uses the generational mode by default. Stream gatherers and the class-file API are still previews.

How to read the status

Language

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

JEP 455 · Preview · Language

Patterns, instanceof, and switch can mention primitive types. This is a preview.

Second preview in Java 24 (JEP 488). Third preview in Java 25 (JEP 507). It is not final in Java 25.

OpenJDK JEP 455 (leaves JavaMastery)

Module Import Declarations (Preview)

JEP 476 · Preview · Language

import module M is a preview. It imports the public types of the packages a module exports.

Final in Java 25 (JEP 511).

OpenJDK JEP 476 (leaves JavaMastery)

Flexible Constructor Bodies (Second Preview)

JEP 482 · Preview · Language

Statements before super(...) are previewed again.

First preview in Java 22 (JEP 447). Final in Java 25 (JEP 513).

OpenJDK JEP 482 (leaves JavaMastery)

Implicitly Declared Classes and Instance Main Methods (Third Preview)

JEP 477 · Preview · Language

The compact-program preview continues.

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

OpenJDK JEP 477 (leaves JavaMastery)

APIs / Libraries

Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal

JEP 471 · Final · APIs / Libraries

The memory-access methods of sun.misc.Unsafe are deprecated for removal. They are not removed in this release.

OpenJDK JEP 471 (leaves JavaMastery)

JVM / Runtime

ZGC: Generational Mode by Default

JEP 474 · Final · JVM / Runtime

ZGC’s default mode is generational. Non-generational ZGC is still available in this release.

Generational ZGC arrived in Java 21 (JEP 439). Java 24 removes the non-generational mode (JEP 490).

OpenJDK JEP 474 (leaves JavaMastery)

Related reading: JVM and memory

Tools / Platform

Markdown Documentation Comments

JEP 467 · Final · Tools / Platform

Documentation comments can be written in Markdown as well as in the traditional comment syntax.

OpenJDK JEP 467 (leaves JavaMastery)

Related reading

Historical notes

String templates are not in this release. Their last preview in this curriculum is Java 22. There is no Java 23 sample. The language changes here were previews. Later final forms are the Java 24 gatherers example and the Java 25 module-import and constructor examples.

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

All versions