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 JavaForge)

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 JavaForge)

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 JavaForge)

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 JavaForge)

APIs / Libraries

Class-File API (Second Preview)

JEP 466 · Preview · APIs / Libraries

The class-file API is previewed a second time.

Final in Java 24 (JEP 484).

OpenJDK JEP 466 (leaves JavaForge)

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 JavaForge)

Vector API (Eighth Incubator)

JEP 469 · Incubator · APIs / Libraries

The Vector API incubates an eighth time.

Still incubating in Java 25.

OpenJDK JEP 469 (leaves JavaForge)

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 JavaForge)

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 JavaForge)

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 JavaForge)

All versions