The Java 27 new features land in nine JEPs: G1 becomes the default garbage collector in every environment, TLS 1.3 negotiates post-quantum hybrid key exchange by default, compact object headers are switched on by default, and JDK Flight Recorder redacts secrets out of the box. The rest are previews and an incubator: Lazy Constants, Structured Concurrency, primitive types in patterns, PEM encodings and the Vector API. JDK 27 reached general availability on September 15, 2026, and it is not a long-term support release.

This guide walks through every JEP in JDK 27 with code you can compile, explains what the GC and object-header defaults mean for containers, and finishes with an upgrade checklist for teams coming from Java 21 or Java 25. Every JEP number and status below comes from the OpenJDK JDK 27 project page and the individual JEP documents.

JDK 27 at a glance

Item Detail
GA date September 15, 2026
Release type Feature release, non-LTS
Latest OpenJDK update (as of Nov 26, 2026) 27.0.1.1, released November 17, 2026
Oracle updates until March 2027, when JDK 28 ships
Current LTS Java 25 (September 2025)
Next planned LTS Java 29 (September 2027)
JEPs 9: four final, four preview, one incubator

The nine JEPs

JEP Title Status in 27
523 Make G1 the Default Garbage Collector in All Environments Final
527 Post-Quantum Hybrid Key Exchange for TLS 1.3 Final
534 Compact Object Headers by Default Final
536 JFR In-Process Data Redaction Final
531 Lazy Constants Third preview
532 Primitive Types in Patterns, instanceof, and switch Fifth preview
533 Structured Concurrency Seventh preview
538 PEM Encodings of Cryptographic Objects Third preview
537 Vector API Twelfth incubator

Is Java 27 an LTS release?

No. Oracle's Java SE support roadmap lists 8, 11, 17, 21 and 25 as LTS releases and names Java 29 (September 2027) as the next planned LTS. Oracle treats non-LTS releases as superseded as soon as the next feature release ships, so JDK 27 gets updates until March 2027 and then you are expected to move to JDK 28.

Practical guidance:

  • Production services on a slow upgrade cadence should stay on Java 25 (or 21) and treat JDK 27 as a preview of what Java 29 will contain.
  • Teams that already ship every six months (common with containerized services and good test coverage) can adopt JDK 27 now. Everything that is final in 27 will be in 29.
  • Library authors should add JDK 27 to the CI matrix today, because the default-behaviour changes below can surface bugs in your users' environments.

Java 27 new features in detail

JEP 523: G1 is now the default collector everywhere

Since JDK 9, HotSpot picked G1 on "server-class" machines but fell back to the Serial collector when it saw a single CPU or less than 1,792 MB of physical memory. That heuristic mattered more than people realised, because small containers, CI runners and cheap cloud instances often look exactly like that.

JEP 523 removes the heuristic: if you do not specify a collector, the JVM always selects G1. The JEP says recent work on G1 (including reduced synchronization in JEP 522 and lower native memory usage) makes G1 competitive with Serial at all heap sizes. It also states plainly that some constrained applications may still do best with Serial, and you can still choose it explicitly.

Check what your JVM actually picks:

java -XX:+PrintCommandLineFlags -version 2>&1 | tr ' ' '\n' | grep -E 'Use.*GC'
# JDK 27 in a 1-CPU container: -XX:+UseG1GC
# JDK 25 in the same container: -XX:+UseSerialGC

To pin a collector, which you should do for any service where latency or memory is measured, set it explicitly:

# Keep the pre-27 behaviour for a tiny sidecar
java -XX:+UseSerialGC -Xmx256m -jar sidecar.jar

# Throughput-oriented batch job
java -XX:+UseParallelGC -jar batch.jar

# Low-latency service with a large heap
java -XX:+UseZGC -jar api.jar

For Kubernetes workloads, set flags through JAVA_TOOL_OPTIONS or the image entrypoint, not inside application code, so operations can change them without a rebuild. If you are already right-sizing pods with Kubernetes in-place pod resize, remember the JVM's ergonomics are computed at startup from the limits it sees then.

A related tuning rename landed in JDK 27: -XX:InitiatingHeapOccupancyPercent is now -XX:G1IHOP. The old name still works but is deprecated, per the JDK 27 release notes.

JEP 534: Compact object headers by default

Compact object headers shrink HotSpot object headers from 96 bits to 64 bits on 64-bit platforms. They were experimental in JDK 24 (JEP 450), became a product feature behind -XX:+UseCompactObjectHeaders in JDK 25 (JEP 519), and in JDK 27 they are on by default. JEP 534 reports that Amazon runs hundreds of production services with the feature, mostly on backports, and SAP already defaults to it in SapMachine.

The JEP cites results such as SPECjbb2015 using 22% less heap and 8% less CPU time in one setting. Treat those as indicative; measure your own heap after the upgrade. Apps with many small objects (maps of boxed values, ORM entity graphs, JSON trees) benefit the most.

If you hit a problem, opt out:

java -XX:-UseCompactObjectHeaders -jar app.jar

The release notes say this opt-out flag is planned for deprecation and removal in a future release. Also note that the UseCompressedClassPointers option is now obsolete; passing it prints a warning and is ignored.

JEP 527: Post-quantum hybrid key exchange for TLS 1.3

Code that uses javax.net.ssl now offers a quantum-resistant key exchange by default, with no code change. JEP 527 adds three hybrid named groups, X25519MLKEM768, SecP256r1MLKEM768 and SecP384r1MLKEM1024, and puts X25519MLKEM768 first in the default list:

X25519MLKEM768, x25519, secp256r1, secp384r1, secp521r1, x448, ffdhe2048, ffdhe3072, ffdhe4096

TLS 1.3 clients therefore send both X25519MLKEM768 and x25519 key shares. If the server supports the hybrid group you get "harvest now, decrypt later" protection; if not, the handshake falls back to x25519. The other two hybrids are available but not enabled by default.

To control the list explicitly:

import javax.net.ssl.*;

SSLSocket socket = (SSLSocket) SSLContext.getDefault()
        .getSocketFactory().createSocket("api.example.com", 443);
SSLParameters params = socket.getSSLParameters();
params.setNamedGroups(new String[] {
    "X25519MLKEM768", "SecP256r1MLKEM768", "x25519", "secp256r1"
});
socket.setSSLParameters(params);

Or set it JVM-wide with -Djdk.tls.namedGroups=X25519MLKEM768,x25519,secp256r1. Two related changes from the release notes: ffdhe6144 and ffdhe8192 were removed from the default named groups, and the JDK now supports zlib TLS certificate compression (RFC 8879), enabled by default. One thing to watch: the hybrid key share makes the ClientHello larger, and some middleboxes and old load balancers mishandle large ClientHellos. If outbound TLS calls from JDK 27 time out while JDK 25 works, test with -Djdk.tls.namedGroups=x25519,secp256r1 to confirm. The server side of this story is covered in our guide to post-quantum TLS with Nginx and OpenSSL.

JEP 536: JFR redacts secrets by default

JFR recordings capture the command line, environment variables and system properties, and that is exactly where people put tokens and passwords. JEP 536 makes JFR redact them by default, replacing values with [REDACTED] before the data leaves the process. The default key filters include *password*, *secret*, *token*, *credential*, *api*key*, *private*key* and *auth*; argument filters also catch pairs like --password SECRET.

Add your own patterns while keeping the defaults (the leading +):

java -XX:FlightRecorderOptions:'redact-key=+*dsn*;*connection*string*' \
     -XX:StartFlightRecording:filename=app.jfr \
     -jar app.jar

Debug matching with -Xlog:jfr+redact=debug, list sub-options with java -XX:FlightRecorderOptions:help, and disable redaction entirely with redact-argument=none,redact-key=none. If your incident tooling parses JFR events for configuration values, expect to see [REDACTED] where it used to see raw values.

JEP 531: Lazy Constants (third preview)

Lazy Constants (formerly the Stable Values API) give you a value that is computed at most once, on first access, even under concurrency, while still letting the JIT constant-fold it like a final field. This third preview removes isInitialized() and orElse() and adds Set.ofLazy(...), alongside the existing List.ofLazy and Map.ofLazy.

// Compile/run with: java --enable-preview OrderController.java
import java.util.logging.Logger;

public class OrderController {
    private final LazyConstant<Logger> logger =
            LazyConstant.of(() -> Logger.getLogger(OrderController.class.getName()));

    void submitOrder() {
        logger.get().info("order submitted"); // created on first use, exactly once
    }

    public static void main(String[] args) {
        new OrderController().submitOrder();
    }
}

LazyConstant lives in java.lang, so no import is needed. Null is not allowed as a computed value.

JEP 533: Structured Concurrency (seventh preview)

Structured concurrency treats a group of subtasks as one unit: if one fails, the others are cancelled, and no thread outlives the try block. The seventh preview changes the API again. StructuredTaskScope gains a third type parameter for the exception join() throws, the default open() now makes join() throw ExecutionException, Joiner.awaitAll() is gone, and a new open(UnaryOperator) overload configures name, timeout and thread factory without passing a joiner.

// java --enable-preview Checkout.java
import java.time.Duration;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.StructuredTaskScope;
import java.util.concurrent.StructuredTaskScope.Subtask;

public class Checkout {
    record Response(String user, int order) {}

    static String findUser() throws InterruptedException { Thread.sleep(100); return "ada"; }
    static int fetchOrder() throws InterruptedException { Thread.sleep(150); return 42; }

    static Response handle() throws ExecutionException, InterruptedException {
        try (var scope = StructuredTaskScope.open(cf -> cf.withTimeout(Duration.ofSeconds(2)))) {
            Subtask<String> user = scope.fork(() -> findUser());
            Subtask<Integer> order = scope.fork(() -> fetchOrder());
            scope.join(); // throws ExecutionException if either subtask fails
            return new Response(user.get(), order.get());
        }
    }

    public static void main(String[] args) throws Exception {
        System.out.println(handle());
    }
}

If the timeout expires, join() throws an ExecutionException whose cause is a CancelledByTimeoutException. If you adopted the JDK 25 or 26 preview, expect compile errors: preview APIs are allowed to change between releases, and this one did.

JEP 532: Primitive types in patterns (fifth preview)

Unchanged from JDK 26, this preview lets patterns, instanceof and switch work with primitive types, matching only when a conversion is exact:

static String status(int code) {
    return switch (code) {
        case 0 -> "okay";
        case 1 -> "warning";
        case int i when i >= 500 -> "server error " + i;
        case int i -> "unknown status " + i;
    };
}

static void narrow(int i) {
    if (i instanceof byte b) {       // matches only if i fits in a byte
        System.out.println("fits in a byte: " + b);
    }
}

JEP 538: PEM encodings (third preview)

The PEM API converts between PEM text and keys, certificates and CRLs without Bouncy Castle boilerplate. This round renames DEREncodable to BinaryEncodable, turns PEM from a record into a class, renames withFactory to withFactoriesOf and adds a CryptoException.

import java.security.*;

PEMDecoder decoder = PEMDecoder.of();
switch (decoder.decode(pemText)) {
    case PublicKey pub -> System.out.println("public key: " + pub.getAlgorithm());
    case PrivateKey priv -> System.out.println("private key: " + priv.getAlgorithm());
    default -> throw new IllegalArgumentException("unexpected PEM type");
}

JEP 537: Vector API (twelfth incubator)

The Vector API remains in the jdk.incubator.vector module and needs --add-modules jdk.incubator.vector. It continues to incubate while it waits on Project Valhalla value classes. Use it only if you are already writing SIMD-style numeric kernels and can absorb API changes.

Running preview features

Preview features are disabled by default and must be enabled at compile time and at run time:

# Single-file source launcher
java --enable-preview Checkout.java

# Classic compile + run
javac --release 27 --enable-preview -d out src/Checkout.java
java --enable-preview -cp out Checkout
<!-- Maven: maven-compiler-plugin -->
<configuration>
  <release>27</release>
  <compilerArgs>
    <arg>--enable-preview</arg>
  </compilerArgs>
</configuration>

Surefire and the runtime also need --enable-preview in their argLine or JVM options. Classes compiled with preview features only run on that exact JDK feature release, which is one more reason to keep previews out of shared libraries.

Removed and changed in JDK 27

From the consolidated release notes, these are the items most likely to break a build or a deployment:

Change Impact
JVMCI removed, including -XX:+UseGraalJIT and the jdk.graal.compiler modules Builds that enabled the Graal JIT on stock OpenJDK must drop the flags (GraalVM distributions are separate)
-noverify, -Xverify:none, -noclassgc, -verifyremote removed Old startup scripts fail; delete the flags
ThreadPoolExecutor.finalize() removed Subclasses calling super.finalize() now hit Object.finalize(), which throws Throwable; may not compile
-Djdk.lang.Process.launchMechanism=VFORK removed (Linux) Use the default POSIX_SPAWN or FORK
java.locale.useOldISOCodes has no effect Use he, yi, id
com.sun.net.httpserver uses path-prefix matching Context /foo no longer matches /foobar
ML-KEM/ML-DSA private keys default to the seed encoding Keys generated on 27 are not readable by older JDKs by default
Launcher no longer allows inheriting a package-private main from another package Rare, but affects some test harnesses
UseCompressedClassPointers obsolete Remove the flag to silence the warning

Upgrade checklist: Java 21 or 25 to JDK 27

  1. Update build tools. Gradle's compatibility matrix lists Java 27 support for both toolchains and running Gradle from 9.8.0. Upgrade Maven plugins (compiler, surefire, jar) and bytecode-processing libraries such as ByteBuddy, ASM, Mockito, Lombok and Jacoco to versions that understand class file version 71.
  2. Run jdeps --jdk-internals against your fat JAR to find use of internal APIs that may have moved.
  3. Grep startup scripts and Helm values for removed flags: UseGraalJIT, EnableJVMCI, noverify, Xverify:none, UseCompressedClassPointers, InitiatingHeapOccupancyPercent.
  4. Decide your GC explicitly. Capture -XX:+PrintCommandLineFlags on the old and new JDK in the same container size and compare. A code difference checker makes the flag diff easy to read. If you relied on Serial in small pods, either pin -XX:+UseSerialGC or load-test G1.
  5. Watch heap metrics for the compact-headers change. Lower heap usage may let you shrink memory requests; do it after a week of data, not on day one.
  6. Test outbound TLS to every partner endpoint. The larger hybrid ClientHello is the most likely source of surprises in old network gear.
  7. Check JFR-based tooling for [REDACTED] values.
  8. Rebuild container images. Eclipse Temurin publishes eclipse-temurin:27-jdk, 27-jre, 27-jre-alpine and Ubuntu 27-jre-resolute tags, among others. Pin 27 or a full version, never latest.
  9. For Spring applications, confirm your Spring Boot line supports JDK 27 before switching; our Spring Boot 4 migration guide covers the framework side.

If you are coming from Java 21, also review the JDK 22 to 25 changes (the Security Manager permanently disabled in JDK 24, the 32-bit x86 port removed in JDK 25, and the JEP 491 fix for virtual threads pinning inside synchronized). JDK 27 is a good dress rehearsal for the Java 29 LTS jump, much like our Python 3.15 upgrade guide recommends running new interpreters in CI well before you need them.

Frequently Asked Questions

When was Java 27 released?

JDK 27 reached general availability on September 15, 2026. The latest OpenJDK update as of late November 2026 is 27.0.1.1, released November 17, 2026.

Is Java 27 LTS?

No. Java 25 is the current LTS, and Oracle's roadmap names Java 29 (September 2027) as the next planned LTS. JDK 27 receives Oracle updates only until JDK 28 ships in March 2027.

What are the main Java 27 new features?

G1 as the default collector in all environments (JEP 523), post-quantum hybrid key exchange for TLS 1.3 (JEP 527), compact object headers by default (JEP 534) and JFR secret redaction (JEP 536). Lazy Constants, Structured Concurrency, primitive patterns and PEM encodings are previews; the Vector API is still incubating.

How do I keep the Serial garbage collector on JDK 27?

Add -XX:+UseSerialGC to the JVM options. Any collector you choose explicitly overrides the default, so pinning the GC also protects you from future default changes.

Do I need code changes for post-quantum TLS in Java 27?

No. Applications using javax.net.ssl offer X25519MLKEM768 first automatically. You only need code or -Djdk.tls.namedGroups if you want to change the order, enable the other hybrid groups, or work around a peer that cannot handle the hybrid key share.

Can I use Structured Concurrency in production on JDK 27?

Only if you accept preview semantics: you must run with --enable-preview, and the API changed again in this release. Most teams should prototype with it and wait for it to become final.

Bottom Line

JDK 27 is a defaults release. Few new APIs are final, but four behaviours change under existing code: the GC choice in small environments, object header layout, the TLS key exchange and JFR output. None of them should break a healthy application, and together they reduce memory use and improve security with no code changes. Upgrade CI first, pin the GC, test outbound TLS, and keep production on Java 25 unless your team already follows the six-month release train. Everything final here will be waiting in Java 29.