Java 27 Arrives With Structured Concurrency and Security
Java 27 is now available with structured concurrency, primitive pattern matching, post-quantum TLS 1.3 support, compact object headers and several runtime changes.
On this page
Java 27 became generally available on September 15, giving developers a new feature release with nine Java Enhancement Proposals, including four preview features and one incubator feature. The release adds structured concurrency, primitive types in pattern matching, lazy constants, a new post-quantum hybrid key exchange for TLS 1.3, and changes to the Java Virtual Machine. For developers upgrading from Java 26, the most practical questions are which features are ready to use, which remain experimental, and where existing applications may encounter compatibility changes.
Java 27 expands concurrency without making it final yet
Structured concurrency is one of the more consequential additions in Java 27, but it remains a preview feature for the seventh time. The API treats related tasks running in different threads as one logical unit, giving applications a clearer way to manage cancellation, failures, and task completion. Instead of treating every background task as an independent operation, developers can keep a group of related tasks under a common lifetime.
That matters for server applications that perform several operations at once. A request might need information from multiple services before it can produce a response; if one operation fails, the application often needs to cancel or stop the others rather than leaving them running unnecessarily. Structured concurrency is designed to make that relationship explicit in the program instead of leaving developers to coordinate separate threads manually.
Because the feature is still a preview, developers should not treat its current API as permanently settled. Preview features require explicit opt-in and can change in later releases. Production teams considering Java 27 therefore need to distinguish between adopting the JDK and adopting its preview APIs.
Pattern matching gets another step toward primitive types
Java 27 also continues the development of primitive types in patterns, instanceof, and switch. This is the fifth preview of the feature. Primitive types are Java's basic numeric and boolean values, such as int, long, float, double, char, and boolean, rather than objects created from classes.
The proposal extends pattern matching so primitive values can participate in contexts that previously focused mainly on reference types. The practical goal is to let developers express type and value checks more directly, reducing some of the conversions and special handling that can make numeric logic harder to read.
Again, the preview label matters. Java 27 lets developers test the direction of the language, but applications that depend on preview syntax should plan for future adjustments rather than assuming the current form is permanent.
Lazy constants target a different kind of startup problem
Lazy constants arrive as a third preview in Java 27. They are designed for unmodifiable data that should behave like a constant to the Java Virtual Machine while allowing its value to be initialized only when needed. That separates two ideas that are often tied together: a value can be immutable once created, but its creation does not necessarily have to happen when the application starts.
This can matter in applications with expensive initialization. If a constant-like object is rarely used, delaying its construction can avoid doing work during startup that provides no immediate benefit. At the same time, the JVM can treat lazy constants as true constants for optimization purposes, according to the Java 27 documentation.
The feature is still under preview, so its biggest value today is giving Java developers a way to evaluate the programming model before the API becomes final. Teams should test startup behavior and application performance rather than assuming that every constant should become lazy.
Java 27 adds post-quantum protection to TLS 1.3
Security is another major part of the release. Java 27 adds post-quantum hybrid key exchange for Transport Layer Security 1.3, the protocol commonly used to protect network connections between applications. A hybrid exchange combines a traditional cryptographic mechanism with a quantum-resistant mechanism, allowing applications to gain protection against future quantum attacks while retaining the established cryptographic approach.
The new support is integrated into the Java Secure Socket Extension APIs and is enabled by default, according to Oracle's release documentation. That means applications using the relevant Java networking APIs can benefit without changing their source code specifically to enable the hybrid exchange.
The change is particularly relevant to software with long-lived sensitive data. Attackers can capture encrypted traffic today and attempt to decrypt it later if sufficiently capable quantum computers become available. Post-quantum cryptography is intended to reduce that future risk, although the actual protection an application receives still depends on its complete network configuration and the algorithms negotiated during a connection.
Compact object headers are now enabled by default
Java 27 also changes the default behavior of compact object headers, a JVM feature introduced earlier to reduce the memory footprint of Java objects. Object headers contain metadata the runtime needs to manage objects, so shrinking that overhead can allow applications to fit more objects into the same amount of heap memory.
In Java 27, compact object headers are enabled by default. Oracle says the change can reduce Java heap footprint and potentially improve performance, while retaining an option to disable the feature for applications that need to compare behavior or work around a specific compatibility issue.
This is one of the changes worth testing rather than merely reading about. Memory-heavy Java services can behave differently from small applications, and the effect depends on object allocation patterns, heap size and garbage-collection behavior. A production upgrade should therefore be measured with the application's real workload.
JDK 27 removes several old launcher and compiler options
The upgrade is not only about additions. Java 27 removes the experimental Java Virtual Machine Compiler Interface and associated Graal Just-In-Time compilation options from the JDK. It also removes several old launcher options, including -noverify, -verifyremote, -Xverify:none, and -noclassgc.
Most developers will never encounter these options, but applications and build systems that still pass them to the Java launcher can be affected. The release notes specifically state that there is no replacement for -noverify or -Xverify:none. Teams maintaining older startup scripts should search those scripts and deployment configurations before switching production workloads to JDK 27.
Java 27 also changes the default behavior of the G1 garbage collector's heap-free-ratio settings. The previous defaults of 40 and 70 become 0 and 100, effectively disabling that particular form of automatic heap resizing after a full garbage collection unless an application explicitly sets the values. This is a runtime behavior change that deserves attention in applications where memory usage is tightly managed.
Java 27 is a feature release, not the new LTS version
There is an important distinction for teams deciding whether to upgrade. Java 27 is the latest Java release, but Java 25 remains the current Long-Term Support release. Oracle says JDK 27 will receive updates under its stated no-fee terms until March 2027, when JDK 28 is expected to supersede it.
That makes Java 27 a useful release for developers who want the latest language, runtime and security features, particularly when they are already testing newer Java versions. Organizations that prioritize a longer stability window may instead continue using Java 25 while evaluating Java 27 in development and staging environments.
The immediate work for an upgrade is therefore less about rewriting existing Java code and more about checking the boundaries. Preview APIs should be isolated from stable production code, removed JVM options should be eliminated from deployment scripts, and memory and startup behavior should be measured under real workloads. Java 27 gives developers several new directions to test, but the safest upgrade path is to separate the mature runtime changes from the experimental language features and adopt each on its own evidence.
Share this post
Written by



