Java 23

Java 23 is a non-LTS feature release following Java 22. It preceded Java 24 (March 2025). Java 23 reached end-of-life in March 2025 and receives no further updates. 

Java 23 Release Details

Release DateSeptember 17, 2024
LTSNo
OpenJDK End-of-LifeMarch 18, 2025
Class File Version67.0
Unicode Version15.1.0
Notable ForPrimitive types in patterns preview, ZGC generational by default, markdown documentation comments 

Java 23 is end-of-life. Organizations running it should upgrade to Java 25 LTS (current). 

Java 23 Language Features 

Primitive Types in Patterns (Preview, JEP 455) 

First preview. Extends pattern matching to primitive types in instanceof and switch. Enables type-safe handling of primitive values without boxing and allows primitive type patterns in nested contexts. 

// Primitive type pattern in switch 

switch (value) { 

    case int i when i > 0 -> processPositive(i); 

    case int i             -> processNonPositive(i); 

    case long l            -> handleLong(l); 

    default                -> handleOther(value); 

// Primitive instanceof without boxing 

if (obj instanceof int i) { 

    // i is a primitive int, no autoboxing 

Flexible Constructor Bodies (Second Preview, JEP 482) 

Second preview (renamed from “Statements before super”). Allows arbitrary statements before explicit constructor invocation. No longer restricted to simple argument computation. Can now initialize fields before calling super(). 

Module Import Declarations (Preview, JEP 476) 

First preview. Import entire modules with import module. All exported packages in the module become available. Simplifies working with modules like java.base that export many packages. 

import module java.base; 

// No need for individual imports: 

// import java.util.List; 

// import java.util.Map; 

// import java.io.IOException; 

// etc. 

Implicitly Declared Classes and Instance Main Methods (Third Preview, JEP 477) 

Third preview with further refinements. Simplified entry-point declarations for beginners and scripting. Finalized in Java 23’s release cycle (JEP 477). 

Java 23 API Changes 

Stream Gatherers (Second Preview, JEP 473) 

Second preview of custom intermediate stream operations. Finalized in Java 24 (JEP 485). 

Class-File API (Second Preview, JEP 466) 

Second preview of the standard API for parsing, generating, and transforming Java class files. Finalized in Java 24 (JEP 466). 

Structured Concurrency (Third Preview, JEP 480) 

Third preview. Treats multiple concurrent tasks as a single unit of work with automatic cancellation on failure. 

Scoped Values (Third Preview, JEP 481) 

Third preview. Immutable data sharing across threads, designed as a replacement for ThreadLocal in virtual thread scenarios. 

Deprecate sun.misc.Unsafe Memory-Access Methods for Removal (JEP 471) 

Formally deprecates the memory-access methods in sun.misc.Unsafe for removal. These methods are replaced by the Foreign Function and Memory API (finalized in Java 22). Applications still using Unsafe must migrate. 

Java 23 Tools 

Markdown Documentation Comments (JEP 467) 

Write JavaDoc comments in Markdown instead of HTML. No more <code>, <pre>, and <em> tags in documentation. 

/** 

 * # ProcessHandler 

 * 

 * Processes incoming requests with configurable retry logic. 

 * 

 * ## Parameters 

 * – `request` – the incoming request 

 * – `maxRetries` – number of retry attempts (default: 3) 

 * 

 * ## Returns 

 * The processing result, or `null` if all retries failed. 

 */ 

Java 23 JVM Changes 

ZGC: Generational Mode by Default (JEP 474) 

Generational ZGC is now the default mode. The non-generational mode is deprecated for removal. Generational ZGC separates young and old generations, reducing allocation stalls for workloads with high object churn. 

Java 23 Upgrade Path 

Java 23 has been end-of-life since March 2025. Recommended upgrade target: 

  • Java 25 LTS: Current LTS. The direct successor. Adds compact source files, AOT method profiling, compact object headers, and finalizes features previewed in Java 23. 

Java 23 applications should upgrade directly to Java 25 LTS. Java 24 is also end-of-life. 

Azul’s Java 23 Support 

Azul Platform Core provides TCK-certified builds of current LTS releases with extended support. A single subscription covers all supported versions from Java 6 through Java 26. 

Contact Us

Contact us to learn more about our migration services, support, modernization services, and more!