What’s New in Java 23? A Deep Dive into the Latest JEPs and Upcoming Java 24
Oracle’s release of Java 23 introduces a suite of preview JEPs—including primitive pattern matching, module import declarations, flexible constructors, and new library APIs—while also previewing performance, tooling, and management enhancements, and it hints at upcoming features slated for Java 24.
Oracle has released Java 23, the latest version of the Java programming language and virtual machine, following Java 21 as the second non‑LTS release.
Java 23 New Features
JEP 455: Primitive Types in Patterns, instanceof, and switch (preview)
This preview adds support for primitive type patterns in all pattern‑matching contexts, enhancing the expressiveness of instanceof and switch statements and improving developer productivity.
JEP 476: Module Import Declarations (preview)
Developers can import all packages exported by a module without placing import statements inside the module, simplifying reuse of modular libraries and easing the learning curve for newcomers.
JEP 477: Implicitly Declared Classes and Instance Main Methods (third preview)
Allows beginners to write simple single‑class programs without needing large‑scale language features, while experienced developers can also create concise programs without heavyweight tooling.
JEP 482: Flexible Constructor Bodies (second preview)
Enables statements before explicit constructor calls (super/this), allowing field initialization prior to delegating to another constructor, thus giving developers more freedom in constructor design.
Libraries
JEP 466: Class‑File API (second preview)
Provides a standard API for parsing, generating, and transforming Java class files, improving developer efficiency.
JEP 469: Vector API (eighth incubator stage)
Introduces an API that compiles vector computations to CPU‑specific vector instructions at runtime, delivering performance superior to equivalent scalar code.
JEP 473: Stream Gatherers (second preview)
Extends the Stream API with custom intermediate operations, enabling more flexible data transformations and improving code maintainability.
JEP 480: Structured Concurrency (third preview)
Offers a new API that groups related tasks into a single unit, reducing risks such as thread leaks and cancellation delays, and enhancing the reliability of multithreaded code.
JEP 481: Scoped Values (third preview)
Supports sharing immutable data within and across threads, improving usability, understandability, performance, and robustness of Java applications.
Performance and Runtime Updates
JEP 474: ZGC – Generational Mode by Default
Switches the default mode of the Z Garbage Collector to generational, lowering maintenance overhead and resource consumption.
Tools
JEP 467: Markdown Documentation Comments
Enables Javadoc comments to be written in Markdown, allowing developers to author and read API documentation more efficiently.
Management Responsibilities
JEP 471: Deprecate the Memory‑Access Methods in sun.misc.Unsafe for Removal
Helps developers identify reliance on unsafe memory‑access methods that are slated for removal, simplifying the toolset in future releases.
Java 24 Upcoming Changes
Java 24 is scheduled for GA in March 2025 and is expected to include several JEPs, such as:
JEP 472: Prepare to Restrict Use of JNI
Proposes limiting JNI usage alongside the Foreign Function & Memory (FFM) API, eventually turning warnings into errors for unsafe native access.
JEP 404: Generational Shenandoah (experimental)
Moves the Shenandoah GC toward a generational design, aiming for inclusion in a future JDK release.
JEP 401: Value Classes and Objects (preview)
Introduces primitive‑like value classes defined via the Valhalla project, enabling new primitive types.
JEP Draft 8334712: Class‑File API
Plans to finalize a public API for class‑file parsing and generation, originally an internal ASM replacement.
JEP Draft 8326035: CDS Object Streams
Proposes a unified CDS object archive format and loader, decoupling GC implementation details from object archiving.
JEP Draft 8300911: PEM API (preview)
Provides APIs for encoding and decoding PEM‑formatted keys and certificates.
JEP Draft 8291976: HTTP/3 Support in HttpClient
Updates the HttpClient introduced in JDK 11 to support the HTTP/3 protocol.
JEP Draft 8312611: Stable Values (preview)
Introduces the concept of stable values—immutable holders initialized at most once—offering performance and safety benefits similar to final fields.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
