Java 24 (JDK 24), released today, March 18, 2025, introduces a variety of new functionalities and enhancements aimed at improving developer productivity, runtime performance, and language capabilities. Below is an overview of the key features, categorized by their status (permanent, preview, incubator, or experimental) based on the Java Enhancement Proposals (JEPs) integrated into this release.
Permanent Features
These features are finalized and fully integrated into JDK 24:
Ahead-of-Time Class Loading & Linking (JEP 483)
Part of Project Leyden, this feature improves JVM startup time by making an application's classes instantly available in a loaded and linked state when the JVM starts. It builds on Application Class Data Sharing (AppCDS) to reduce overhead, particularly beneficial for short-lived programs or cloud-based applications.
Class-File API (JEP 484)
A standardized API for parsing, generating, and transforming Java class files, now finalized after previews in JDK 22 and 23. It serves as an internal replacement for ASM in the JDK and supports tools and frameworks like Spring and Hibernate that manipulate bytecode.
Stream Gatherers (JEP 485)
Enhances the Stream API by allowing developers to define custom intermediate operations. This makes stream pipelines more flexible and expressive, enabling operations on infinite streams. The java.util.stream.Gatherers class provides standard implementations, and developers can create their own using functional interfaces like Integrator.
Synchronize Virtual Threads without Pinning (JEP 486)
Improves virtual thread performance by eliminating pinning (where a virtual thread remains tied to a platform thread) when using synchronized blocks or methods around blocking operations. This makes virtual threads more practical for a wider range of use cases.
Key Derivation Function API (JEP 478)
Introduces a new javax.crypto.KDF API for key derivation functions, enabling cryptographic algorithms like HMAC-based Extract-and-Expand (HKDF) and Argon2. This supports post-quantum cryptography efforts, such as Hybrid Public Key Encryption (HPKE), and enhances security for applications interacting with cryptographic hardware.
Late Barrier Expansion for G1 (JEP 491)
Optimizes the G1 garbage collector by shifting barrier expansion (used to track memory accesses) to a later stage in the C2 JIT compilation pipeline, simplifying implementation and potentially improving performance.
Remove the Windows 32-bit x86 Port (JEP 479)
Discontinues support for the 32-bit Windows x86 JVM, following its deprecation in JDK 21, as modern hardware overwhelmingly uses 64-bit architectures.
Permanently Disable the Security Manager (JEP 493)
Removes the Security Manager entirely (deprecated since JDK 17), reflecting its diminished role in modern Java security. Applications relying on it may require architectural changes.
ZGC: Remove the Non-Generational Mode (JEP 490)
Eliminates the non-generational mode of the Z Garbage Collector, streamlining maintenance and focusing on the generational mode, which is more efficient for most use cases.
Warn upon Use of Memory-Access Methods in sun.misc.Unsafe (JEP 498)
Issues runtime warnings when memory-access methods in sun.misc.Unsafe are invoked, encouraging migration to safer alternatives like the VarHandle API or Foreign Function & Memory API.
Deprecate the 32-bit Linux x86 Port for Removal (JEP 501)
Marks the 32-bit Linux x86 port as deprecated, with removal planned for a future release, aligning with the shift away from 32-bit architectures.
Linking Runtime Images without JMODs (JEP 482)
Allows jlink to create custom runtime images without JMOD files when built with the --enable-linkable-runtime option, reducing image size for cloud-optimized deployments.
Preview Features
These features are fully implemented but subject to change based on feedback:
Scoped Values (Fourth Preview) (JEP 487)
Enables sharing immutable data within and across threads more efficiently than thread-local variables. This fourth preview refines the feature introduced in JDK 20.
Primitive Types in Patterns, instanceof, and switch (Second Preview) (JEP 488)
Extends pattern matching to support primitive types in instanceof and switch statements, enhancing expressiveness (introduced in JDK 23).
Flexible Constructor Bodies (Second Preview) (JEP 492)
Allows more natural initialization logic in constructors by permitting statements before super() calls, reducing reliance on auxiliary methods (introduced in JDK 23).
Module Import Declarations (Second Preview) (JEP 494)
Simplifies importing all packages exported by a module with a single declaration, improving modularity (introduced in JDK 23).
Simple Source Files and Instance Main Methods (Fourth Preview) (JEP 495)
Evolves the Java language to ease beginners into programming by supporting streamlined single-class programs with implicit declarations (refined since JDK 21).
Structured Concurrency (Fourth Preview) (JEP 499)
Simplifies multithreaded programming by treating groups of related tasks as a single unit, enhancing reliability and observability (refined since JDK 21).
Incubator Features
These are still in development and provided for early feedback:
Vector API (Ninth Incubator) (JEP 489)
Enhances vector computations for performance on modern CPUs, adding support for 16-bit floats (Float16) and refining operations. It remains in incubation until Project Valhalla’s features mature.
Experimental Features
These are exploratory and disabled by default:
Generational Shenandoah (JEP 404)
Introduces an experimental generational mode to the Shenandoah garbage collector, aiming to reduce pause times by separating young and old objects.
Compact Object Headers (JEP 450)
Reduces object header size from 96-128 bits to 64 bits on 64-bit architectures (Project Lilliput), lowering memory usage but requiring explicit enabling due to potential risks.
Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism (JEP 496)
Provides an implementation of a quantum-resistant key encapsulation mechanism (ML-KEM, FIPS 203), enhancing cryptographic security.
Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm (JEP 497)
Implements a quantum-resistant digital signature algorithm (ML-DSA, FIPS 204), complementing JEP 496 for post-quantum cryptography.
Additional Notes
Performance and Internal Changes: Features like Ahead-of-Time Class Loading, Compact Object Headers, and G1 optimizations target runtime efficiency, particularly for cloud and serverless environments.
Deprecations and Removals: The removal of legacy components (e.g., Windows 32-bit port, Security Manager) reflects Java’s focus on modern platforms and security practices.
Preview Continuity: Many preview features are iterations of prior work under projects like Amber (pattern matching, module imports), Loom (virtual threads, structured concurrency), and Panama (Vector API), indicating ongoing refinement.
Java 24 is a non-LTS release, supported for six months until JDK 25 (an LTS release) arrives in September 2025. Developers can explore these features to prepare for future standards while leveraging immediate benefits in performance and flexibility. For detailed examples and usage, the official JDK 24 documentation and JEP pages provide comprehensive resources.