After six months of development, Oracle has announced the release of Java SE 24, based on the open source OpenJDK project, maintaining backward compatibility so that most previously developed projects will continue to run without modifications.
Unlike long-term support (LTS) releases, Java SE 24 is a regular support release, which means updates until the next release. For those looking for long-term stability, Java SE 21 and Java SE 17 will continue to receive support until 2031 and 2029, respectively. Additionally, Java SE 8 LTS extended support will continue until 2030, while Java SE 11 will remain in effect until 2032.
Improvements and news
In this new version of Java SE 24, one of the most important improvements is the introduction of An experimental generative mode for the Shenandoah garbage collector (designed to process new and old objects separately). This new mode improves efficiency in cleaning up short-lived objects, optimizes memory usage, and offers more stable performance under varying loads.
Another novelty that stands out is the Experimental support for compact object headers in the HotSpot JVM, reducing its size from 96 to 64 bits on 64-bit systems. This optimization contributes to a smaller heap size and improved memory cache efficiency.
The garbage collector G1 has also been optimized with a redesign of barriers that monitor memory access by applications. Barrier expansion is now performed later in the compilation phase within the C2 JIT compiler, reducing its overhead by up to 20%, depending on the application type.
Security and encryption improvements
Java SE 24 introduces an API for the derivation of cryptographic keys (KDF), allowing the generation of additional keys based on a secret key and an arbitrary set of data. This API, still in preview, strengthens key management security within the platform.
Furthermore, Warnings about the use of APIs have been added Java Native Interface and Foreign Function & Memory, in preparation for the future implementation of an integrity mode, which will restrict default access to native code. Warnings have also been enabled when using external memory access methods via the sun.misc.Unsafe class, and migration to the VarHandle API is recommended.
On the other hand, in Java SE 24 the support for ML-KEM cryptographic algorithms and ML-DSA (designed to be resistant to quantum computing attacks). These algorithms are based on network theory problems, ensuring that solution times are equivalent on both conventional and quantum computers.
The Java Security Manager, which had been deprecated since the disappearance of browser plug-in support, has been permanently removed.
Optimizations
JVM HotSpot now allows preloading and linking classes early, which significantly speeds up application startup. On first run, class state is cached to facilitate loading on future launches.
Likewise, The implementation of Scoped Values ​​has been improved, which now pallows sharing immutable data between threads more efficiently, replacing the traditional thread-local variable mechanism. This is especially beneficial when working with millions of virtual threads simultaneously.
Another novelty is the optimization of virtual threads in blocked statesIn this release, a blocked virtual thread frees up its platform thread, allowing it to be reused by other threads, improving scalability on systems with high multithreading usage.
Of the other changes that stand out:
- New extension to the Stream API, allowing you to define custom intermediate operations.
- Pattern matching engines have been enhanced to support primitive types (int, byte, char, etc.) in switch expressions and the instanceof operator.
- A fourth preview of the Structured Concurrency API has been added, which simplifies the development of multithreaded applications by treating tasks on different threads as a single execution unit.
- A simpler way to declare classes and define the main() method has been introduced, eliminating the need to define a public class with static methods.
- A class file API has been added, allowing you to parse, generate, and transform Java class files more easily and programmatically.
Finally, if you are interested in being able to know more about it, you can consult the details in the following link
Download Java SE 24
For those interested in installing the new version of Java SE 24, you should know that the compilations (JDK, JRE and Server JRE) are already ready for Linux, Windows and macOS.