JDK 23 Changelog: All New Features
A complete list of features and JEPs in JDK 23 (September 2024), including Primitive Types in Patterns, Markdown Documentation Comments, and ZGC Generational by Default.
JDK 23 Changelog
JDK 23 was released on 17 September 2024 as a consolidation release: it advances the preview features from earlier releases and introduces Markdown Documentation Comments. An important note: the previous String Templates (JEP 459) feature was removed from this release due to design concerns.
JEP Summary
| JEP Number | Feature |
|---|---|
| 455 | Primitive Types in Patterns, instanceof, and switch (Preview) |
| 466 | Class-File API (Second Preview) |
| 467 | Markdown Documentation Comments |
| 469 | Vector API (Eighth Incubator) |
| 471 | Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal |
| 473 | Stream Gatherers (Second Preview) |
| 474 | ZGC: Generational Mode by Default |
| 476 | Module Import Declarations (Preview) |
| 477 | Implicitly Declared Classes and Instance Main Methods (Third Preview) |
| 480 | Structured Concurrency (Third Preview) |
| 481 | Scoped Values (Third Preview) |
| 482 | Flexible Constructor Bodies (Second Preview) |
Key Features
Markdown Documentation Comments (JEP 467)
Javadoc documentation comments can now be written in Markdown, making API docs more convenient and readable:
/**
* Calculates the area of a circle.
*
* ## Usage
* {@snippet :
* double a = Circle.area(2.0);
* }
*
* @param radius circle radius
* @return the area
*/
public static double area(double radius) { ... }
ZGC: Generational Mode by Default (JEP 474)
The generational ZGC — introduced in JDK 21 — becomes the default mode. The increase in throughput and the reduction in pause times make ZGC suitable for a much broader audience:
java -XX:+UseZGC -jar app.jar
# Generational mode is now active without extra flags
Primitive Types in Patterns (JEP 455) — Preview
Pattern matching is extended to primitive types, letting you match int, long, etc. in switch and instanceof patterns:
int value = 42;
String kind = switch (value) {
case 0 -> "zero";
case 42 -> "answer";
default -> "other";
};
Stream Gatherers (JEP 473) — Second Preview
Gatherer support continues to evolve for more expressive Stream aggregations, this time including windowFixed:
List<List<String>> windows = Stream.of("q", "w", "e")
.gather(Gatherers.windowFixed(2))
.map(w -> w.toList())
.toList();
Module Import Declarations (JEP 476) — Preview
Lets you import all modules exported by a package in a single line, reducing boilerplate in modular applications:
module app {
requires java.sql;
uses java.sql.Driver;
// With the preview:
// import module java.net; etc.
}
Deprecate Memory-Access Methods in sun.misc.Unsafe (JEP 471)
This starts the path toward removing the memory-access methods of sun.misc.Unsafe, steering developers toward the FFI API (JEP 454).
Other Changes
- Class-File API (466): Second preview.
- Flexible Constructor Bodies (482): Second preview.
- Scoped Values (481): Third preview.
- Structured Concurrency (480): Third preview.
- Implicitly Declared Classes and Instance Main Methods (477): Third preview.
- Vector API (469): Eighth incubator.
- String Templates (459): Removed from the release due to design concerns.
Conclusion
JDK 23 is a very solid intermediate release that consolidates the incubating and preview APIs, adds Markdown support in Javadoc, and makes generational ZGC the default. It does not introduce a revolutionary feature, but it paves the way for the next two releases, where many of these capabilities reach their final state.