
Oracle has announced the release of Java 24, which adds several new features to the language, such as the availability of the Stream Gatherers API and Class-File API, and new features designed for AI inference and quantum security.
“Over the past 30 years, Java has provided developers with a comprehensive platform to build and deploy applications that address a diverse range of use cases,” said Georges Saab, senior vice president for the Oracle Java Platform and chair of the OpenJDK governing board. “With more than 20 new features spanning every element of Java, including new AI and post-quantum crypto capabilities, the Java 24 release gives developers the tools they need to build innovative, AI-infused applications. As the stewards of Java, we’re excited to work with the global Java
community to continue delivering a steady stream of new features via our predictable, six-month cadence.”
This release is the final Java release before the next Long-Term Support (LTS) release in September. According to Saab, Java 25 will not have a lot of newer features compared to Java 24, so developers can now start preparing for that next release by experimenting with Java 24.
Java 24 includes the release of the Steam Gatherers API, which supports custom intermediate operations, allowing stream pipelines to transform data in ways that are difficult when using built-in intermediate options. According to Oracle, this API will allow Java developers to be more efficient when reading, writing, and maintaining their Java code.
The Class-File API was also finalized in this release, and it provides a standard API for parsing, generating, and transforming Java class files, as well as tracking the class file format that is defined by the JVM specification. According to the developers who worked on this API, the six-month release schedule for Java has caused some issues with class files, because often third-party frameworks include class-files that are older than the current version, resulting in errors.
“The Java Platform should define and implement a standard class-file API that evolves together with the class-file format,” they wrote in the JEP. “Components of the Platform would be able to rely solely on this API, rather than rely perpetually on the willingness of third-party developers to update and test their class-file libraries. Frameworks and tools that use the standard API would support class files from the latest JDK automatically, so that new language and VM features with representation in class files could be adopted quickly and easily.”
A number of performance improvements were also included in this release, including ahead-of-time class loading and linking, removal of the non-generational mode from the Z garbage collector (ZGC), late barrier extension for the G1 garbage collector, and the ability to synchronize virtual threads without pinning.
Hardening Java for post-quantum world
Java 24 introduces several new security features aimed at hardening Java for quantum computing. The Key Derivation Function API (in preview) offers cryptographic security for data in transit. This release also offers implementations in Java of the Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism and the Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm, both of which are NIST standards for quantum security.
“You know, the industry consensus is that it’s not a matter of if, but a matter of when quantum computing is going to render existing cryptographic schemes breakable,” said Donald Smith, vice president of Java Product Management at Oracle. “So there is a lot of interest in the industry to develop quantum resistant algorithms for communication and signing and so on. And we’re starting to get a lot of questions, ‘hey, when are we going to have quantum resistant algorithms in Java?’”
Java 24 puts focus on AI inference
Primitive Types in Patterns, instanceof, and switch (JEP 488) — currently in its second preview — aims to make the language more uniform and expressive. According to Oracle, this feature will be particularly useful to developers integrating AI inferencing into their applications.
“A lot of application developers who are using or integrating with an inference engine, they’re often pulling together large sets of primitive data,” Smith explained. “So you may have a record type of some kind, and you want to pull out some variable from that—it’s usually a primitive— and then send that into an inference engine to try to understand the data a little better, right? And so that JEP is going to help make that job a lot easier.”
Other new features in this area include the second preview of Module Import Declarations, which allows developers to more easily integrate business logic with AI inference, libraries, and service calls, and another incubation of the Vector API, which is often used in AI inference.