After six months of development, Oracle has released Java SE 27 (Java Platform, Standard Edition 27), which uses the open source OpenJDK project as its reference implementation. With the exception of the removal of some deprecated features, Java SE 27 maintains backward compatibility with previous releases of the Java platform—most previously written Java projects will run unchanged under the new version. Ready-to-install builds of Java SE 27 (JDK, JRE, and Server JRE) are prepared for Linux (x86_64, AArch64), Windows (x86_64) and macOS (x86_64, AArch64). Developed by the OpenJDK project, the Java SE 27 reference implementation is fully open source under the GPLv2 license with the GNU ClassPath Exception, which allows dynamic linking with commercial products.
Java SE 27 is categorized as a regular support release, with updates being released until the next release. The long-term support (LTS) branch should be Java SE 25, Java SE 21, or Java SE 17, with updates being released until 2033, 2031, and 2029, respectively (generally available until September 2030, 2028, and 2026). Extended support for the Java SE 8 LTS branch will continue until 2030, and for Java SE 11, until 2032.
Changes in Java SE 27 (1, 2, 3, 4) include:
- By default, all environments use the G1 (Garbage-First) garbage collector, previously used for server systems. G1 is optimized for use on multiprocessor systems with large memory capacities and for balancing predictable latency with high throughput. During operation, G1 divides memory into many small regions and prioritizes those regions with more unused objects and less actively accessed data.
- The HotSpot JVM uses compact object headers by default. On 64-bit systems, the header size has been reduced from 96 to 64 bits, reducing memory consumption and increasing the likelihood of data hitting the processor cache. In SPECjbb2015 benchmarks, memory consumption decreased by 22%, CPU load decreased by 8%, and the number of garbage collection operations decreased by 15%. Test run times for the JSON parser were reduced by 10%.
- The TLS 1.3 implementation adds support for hybrid key agreement schemes that combine the quantum-resistant ML-KEM (CRYSTALS-Kyber) algorithm with classical ECDHE elliptic curve algorithms: X25519MLKEM768 (ECDHE with the X25519 curve + ML-KEM-768), SecP256r1MLKEM76 (ECDHE with the secp256r1 curve + ML-KEM-768), and SecP384r1MLKEM1024 (ECDHE with the secp384r1 curve + ML-KEM-1024). In the javax.net API.ssl These schemes are enabled by default and do not require any application changes to use.
- JDK Flight Recorder (JFR), a tool used for performance monitoring, profiling, and diagnostics, now supports sanitizing command-line arguments, initial values of environment variables, and system properties in saved diagnostic information. This change prevents leakage of sensitive data processed by the profiled process, such as authorization tokens and API access keys passed via environment variables.
- The third preview of the Lazy Constants API has been implemented for working with objects containing immutable data and treated as constants in the JVM. Performance optimizations similar to those for fields with the "final" keyword are applied to such objects. Unlike "final," the new API separates the creation of constant values from their initialization, guarantees that a value can be initialized only once, reduces program startup time, and enables constant-folding optimizations, previously used only in JDK-internal code, to be used in user code. class Application { // Previously: // static final UserService USERS = new UserService(); // Now: static final StableValue USERS = StableValue.of(); public static UserService users() { return USERS.orElseSet(UserService::new); } }
- The pattern matching engine introduces a fifth draft of the ability to use primitive types (int, byte, char, and other non-object base types) in all kinds of patterns, in the instanceof operator, and in switch blocks. switch (x.getStatus()) { case 0 -> "okay"; case 1 -> "warning"; case 2 -> "error"; case int i -> "unknown status: " + i; } if (i instanceof byte b) { … b … }
- The seventh draft of the Structured Concurrency API, which simplifies the development of multithreaded applications by treating multiple tasks running on different threads as a single unit, has been released for testing.
- The twelfth test implementation of the Vector API has been implemented. This API provides functions for vector computations performed using x86_64 and AArch64 processor vector instructions and allows for simultaneous operations on multiple values (SIMD). Unlike the HotSpot JIT compiler's auto-vectorization of scalar operations, the new API allows explicit control over vectorization for parallel data processing.
- A third draft of the API is now available for encoding and decoding objects containing cryptographic keys, certificates, and certificate revocation lists using the PEM (Pivacy-Enhanced Mail) format.
Additionally, we're pleased to announce the release of an update to the JavaFX 27 platform for creating graphical user interface applications. The release of the GraalVM 27 universal virtual machine, which supports running applications in JavaScript (Node.js), Python, Ruby, R, any JVM language (Java, Scala, Clojure, Kotlin), and languages for which LLVM bitcode can be generated (C, C++, Rust), is also expected in the coming hours.
Source: opennet.ru
