Overview of New Features in Java 24

Introduction Java 24 was released on 18th March 2025, with twenty-four JDK Enhancement Proposals (JEPs) - more than any release since Java moved to a six-month release cadence. It finalized stream gatherers and the Class-File API, made applications start faster with an ahead-of-time cache, let virtual threads block inside synchronized without pinning, added quantum-resistant cryptography, and permanently disabled the Security Manager. This article gives an overview of the new features in Java 24, with links to detailed tutorials. Libraries and language
  1. Stream Gatherers - JEP 485 - custom intermediate stream operations, with built-in gatherers such as windowFixed, scan and mapConcurrent. Read the stream gatherers tutorialClick to read tutorial: Java 24 Stream Gatherers Tutorial with Examples.
  2. Class-File API - JEP 484 - a standard API for reading, writing and transforming class files. Read the Class-File API tutorialClick to read tutorial: Java 24 Class-File API Tutorial with Examples.
  3. Previews - flexible constructor bodies (third preview, JEP 492), module import declarations (second preview, JEP 494), simple source files and instance main methods (fourth preview, JEP 495) and scoped values (fourth preview, JEP 487) - all final in Java 25Click to read tutorial: Overview of New Features in Java 25; primitive types in patterns (second preview, JEP 488), structured concurrency (fourth preview, JEP 499), the key derivation function API (preview, JEP 478; final in Java 25) and the Vector API (ninth incubator, JEP 489).
Performance and runtime
  1. Ahead-of-Time Class Loading & Linking - JEP 483 - a training run records which classes an application loads, and an AOT cache gives later runs those classes already loaded and linked. Read about the AOT cacheClick to read tutorial: AOT Cache in Java 24 and 25: Faster Startup.
  2. Synchronize Virtual Threads without Pinning - JEP 491 - virtual threads can now unmount while inside synchronized. Read about virtual threads without pinningClick to read tutorial: Java 24: Virtual Threads in synchronized Without Pinning.
  3. Compact Object Headers (Experimental) - JEP 450 - object headers shrink from 12 to 8 bytes; a product feature in Java 25 - read about compact object headersClick to read tutorial: Java 25 Compact Object Headers Explained.
  4. Generational Shenandoah (Experimental) - JEP 404 - Shenandoah gains young and old generations, like generational ZGCClick to read: generational ZGC; a product feature in Java 25.
  5. ZGC: Remove the Non-Generational Mode - JEP 490 - ZGC is now always generational.
  6. Late Barrier Expansion for G1 - JEP 475 - an internal change to how G1's barriers are compiled, which simplifies the JIT compiler and speeds up compilation.
  7. Linking Run-Time Images without JMODs - JEP 493 - jlink can build custom runtimes without the JDK's .jmod files, letting JDK builds be about 25% smaller.
Security
  1. Quantum-Resistant ML-KEM - JEP 496 and ML-DSA - JEP 497 - post-quantum key encapsulation and digital signatures standardized by NIST. Read about ML-KEM and ML-DSAClick to read tutorial: Java 24 Quantum-Resistant Crypto: ML-KEM and ML-DSA.
  2. Permanently Disable the Security Manager - JEP 486 - the Security Manager, deprecated in Java 17Click to read: deprecated in Java 17, can no longer be enabled; System.setSecurityManager() throws an exception.
Integrity: preparing to restrict unsafe operations
  1. Prepare to Restrict the Use of JNI - JEP 472 - loading and calling native code through JNI now prints a warning unless allowed with --enable-native-access, the same rule as for the Foreign Function & Memory APIClick to read tutorial: Java 22 Foreign Function & Memory API Tutorial.
  2. Warn upon Use of Memory-Access Methods in sun.misc.Unsafe - JEP 498 - the first use of a memory-access method of Unsafe prints a warning.
Removals and deprecations
  1. Remove the Windows 32-bit x86 Port - JEP 479 and Deprecate the 32-bit x86 Port for Removal - JEP 501 - 32-bit Windows support was removed, and the last 32-bit port, for Linux, was deprecated; it was removed in Java 25.
Summary In this article we went through the new features of Java 24. Stream gatherers and the Class-File API became final, the AOT cache made applications start faster, and virtual threads stopped pinning in synchronized code. Java 24 also added ML-KEM and ML-DSA, previewed compact object headers and generational Shenandoah, permanently disabled the Security Manager, began warning about JNI and Unsafe memory access, and removed the Windows 32-bit port. Next, read the overview of new features in Java 25Click to read tutorial: Overview of New Features in Java 25.