Java 24: Stream Gatherers, Class-File API and quantum-resistant algorithms

A total of 24 JEPs in JDK 24 extend stream processing, introduce quantum-resistant algorithms and provide an API for accessing class files.

listen Print view

(Image: erstellt mit KI (Midjourney) durch iX-Redaktion)

4 min. read
Contents

Java 24 has been released at the start of the JavaOne 2025 conference in Redwood Shores, California. The programming language is celebrating a milestone birthday this year: James Gosling presented the first Java version thirty years ago.

The current release includes a total of 24 Java Enhancement Proposals (JEPs), a record number since Java releases have been published every six months. However, most of the JEPs in Java 24 continue earlier innovations, many of them as further previews.

Videos by heise

Java 24 finalizes two important features, with Stream Gatherers and the Class-File API. Both have had two previews each in Java 22 and Java 23.

Stream Gatherers extend the Java Stream API with additional operations that enable the modification of streamed data with custom transformations.

The Class File API makes it possible to parse, create and convert Java classes. Until now, developers had to rely on external libraries such as ASM or Apache Commons BCEL (Byte Code Engineering Library). The Class File API provides the basic functions in Java Core in a future-proof way, but is not intended to replace the external libraries with their more extensive functions.

As the latest JDK for which LTS (Long-term Support) releases are available, Java 21 brought extensive innovations for concurrent programming in Project Loom. Loom means loom, i.e., the tool for weaving the threads together to form a large whole.

Two important features remain in the preview phase in Java 24: Structured Concurrency helps to manage tasks from different threads in one unit to improve the maintainability and reliability of concurrent code. Scoped Values ensure that immutable data can be shared both in the calls within a thread and in child threads.

Two innovations for improved security are being incorporated into the JDK as stable features without a preview. They extend Java with quantum-resistant algorithms standardized by NIST in FIPS 2023.

JEP 496 offers an implementation of the Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM) key encapsulation method. JEP 497 aims at quantum-safe digital signatures with an implementation of the Module-Lattice-Based Digital Signature Algorithm (ML-DSA).

The Vector API has still not made it into the preview phase, but has now reached its ninth run in the incubator in JDK 24. It will remain there until the required features in Project Valhalla for Value and Primitive Types reach preview status. The Vector API is used to utilize current CPU architectures and instruction extensions such as Single Instruction Multiple Data (SIMD) and vector processors for vector calculation.

JEP status: Incubator and preview

In the further development of the OpenJDK, the incubator is the experimental stage before the preview. It indicates that the functions are not yet fully developed, may change fundamentally and may not even be included in the language. Not all innovations go through the incubator, but some go directly into the preview and others even into the language without a preview.

Preview features are fully specified and implemented, but may still undergo changes. Although there is no guarantee that they will actually end up in the language, this is very likely with preview features, as the past has shown.

There are also some new features for the garbage collector. Among other things, the Shenandoah Garbage Collector now has Generational Mode, which manages a “young space” for new objects and an “old space” for old objects. The Z Garbage Collector (ZGC) has been using the generational mode by default since Java 23, and in Java 24 the non-generational mode disappears for good.

Ahead-of-Time Class Loading & Linking is intended to improve the start-up and warm-up times of applications and relies on transparent caching that does not require any changes to the application code.

A complete and detailed description of the JEPs can be found in the iX article on Java 24.

(rme)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.