← Back to blog

September 16, 2026 · 13 min read

Java 27: What's New, Is It LTS, and What Actually Changes

  • #Java
  • #JDK
  • #Language Features
  • #Performance

Java 27 reached general availability on September 15, 2026 — nine JEPs, four of them final, four in preview, one still incubating. It's a Short Term Support release, not an LTS, which changes how you should think about it: you don't need a migration plan, because nothing forces you off Java 25 (the last LTS). What you do need is to know which of these nine changes land on you automatically the next time you bump your JDK version, and which ones you have to explicitly ask for with --enable-preview. Those are very different categories, and conflating them is how a routine JDK bump turns into a surprise incident.

Is Java 27 an LTS release?

No. Java 27 is a Short Term Support (STS) release, not an LTS. The current LTS is Java 25 (September 2025), and the next LTS is Java 29, due September 2027. LTS releases now come every two years — 17, 21, 25, 29 — and the releases in between (Java 26 and Java 27 in this cycle) are typically supported only until the next one ships, about six months later. If you're choosing a version to standardize production on, choose Java 25 today and plan for 29; use Java 27 to try what's coming. (Installing a JDK for the first time? Setting up your Java environment walks through picking a version and a distribution.)

A release-train timeline showing JDK 25 LTS in September 2025, JDK 26 STS in March 2026, JDK 27 STS in September 2026 highlighted as current, and JDK 29 as the next LTS in September 2027, with a caption noting STS releases are supported for six months

Where this sits in the release train

Java has shipped every six months since Java 10, alternating feature releases with the occasional LTS (Long Term Support) designation — currently every fourth release: 17, 21, 25, and the next one, 29, due September 2027. Java 27 is a Short Term Support (STS) release sitting between LTS 25 and LTS 29, alongside Java 26 (March 2026). Vendors typically support an STS release for about six months, until the next one ships — Azul's build, for example, is supported through March 2027.

That support window is the whole story for whether you should care about Java 27 on a production service. If you're running an LTS build in production — and most companies are — nothing here is urgent. What Java 27 is actually good for is previewing: every preview feature in this release is a feature that will eventually land, finalized, in Java 29. Trying it now, on a side project or a non-critical service, is how you show up to the LTS upgrade already knowing the API instead of learning it under deadline pressure.

What changes without you asking: the three final JEPs

Three JEPs are final in Java 27, meaning they're on by default the moment you point your build at this JDK — no flag, no opt-in, no preview mode.

Three panels showing the default changes in Java 27: G1 becomes the default garbage collector everywhere, compact object headers shrink typical heap usage by 10 to 20 percent, and JFR redacts secrets from recordings automatically, with a caption that none of these require a flag to take effect

G1 everywhere (JEP 523)

Before Java 27, the JVM picked a garbage collector based on the environment it detected — G1 on a machine with enough memory and cores, Serial GC on a constrained one (a small container, for instance). JEP 523 removes that branching: G1 is now the default collector, full stop, in every environment. If you were relying on the JVM quietly falling back to Serial GC inside a memory-constrained container, that fallback is gone — you'll get G1's throughput/latency tradeoff instead, which behaves differently under tight memory limits.

Nothing about this requires a code change, and for the overwhelming majority of services it's a non-event — G1 has been Java's general-purpose default since Java 9 and is well understood. The one group that should actually benchmark before rolling this out: anything running in a genuinely memory-constrained container (think double-digit MB heaps) that was benefiting from Serial GC's lower fixed overhead. Everyone else can treat this as free.

# still available if G1 turns out to be the wrong call for your workload
java -XX:+UseSerialGC -jar app.jar
java -XX:+UseZGC -jar app.jar

Compact object headers, on by default (JEP 534)

This one you'll actually feel. Every object on the Java heap carries a header — bookkeeping the JVM uses for the garbage collector, synchronized, hashCode(), and type identity. That header used to cost 96 bits on a 64-bit JVM; JEP 534 (building on work previewed since Java 25) shrinks it to 64 bits and makes the compact layout the default. Real-world numbers from the JDK team put typical heap usage down 10–20%, which flows straight into less GC pressure and better data locality — you get some of the benefit of a smaller heap without actually shrinking -Xmx.

It's on by default, and for almost everyone that's exactly what you want. If you hit trouble — a native library that pokes at object layout directly, for instance — you can revert it:

java -XX:-UseCompactObjectHeaders -jar app.jar

JFR stops leaking your secrets (JEP 536)

Java Flight Recorder is the low-overhead profiler you leave running in production. Its blind spot was that recordings captured command-line arguments and the initial values of environment variables and system properties verbatim — which meant a -Dapi.key=sk_live_... or a DATABASE_PASSWORD env var could end up sitting in a .jfr file that then gets attached to a support ticket or shipped to a shared diagnostics bucket. JEP 536 redacts that class of sensitive-looking data in-process, before it ever gets written to the recording — no separate scrubbing step, no trusting whoever opens the file next not to grep it for password=.

You don't configure this to get the protection; it's default behavior in Java 27's JFR. It's worth knowing about specifically because it's a default-security-posture change to a tool most teams already have running everywhere, unattended.

The one that matters even if you never notice it: post-quantum TLS (JEP 527)

JEP 527 finalizes hybrid key exchange for TLS 1.3: instead of negotiating a handshake with a single classical algorithm (like ECDHE), the JVM now combines that classical algorithm with a quantum-resistant one (ML-KEM), deriving the session key from both. If a quantum computer ever breaks the classical half, the connection is still only as weak as the post-quantum half — an attacker has to break both to read the traffic.

This is entirely handled at the TLS handshake layer. Nothing in your code changes, no new API to call — any service doing outbound HTTPS or accepting inbound TLS 1.3 on Java 27 gets this automatically, negotiated transparently with any peer that also supports it. The reason it's worth knowing about by name rather than just letting it happen silently: "harvest now, decrypt later" is a real, already-active threat model — traffic captured today can sit on disk until quantum hardware catches up to decrypt it retroactively. If you handle data with a multi-year confidentiality requirement (health records, long-lived credentials, anything under regulatory retention), this JEP is the reason to actually prioritize the Java 27 upgrade instead of treating it as just another six-month release.

What's still preview — try it, don't ship it

Four JEPs are in preview, which in Java means: implemented, usable, gated behind --enable-preview on both javac and java, and not yet API-stable — the shape can still change before finalization. All four are carrying over from earlier releases, several previews deep, which is a reasonable signal they're converging rather than still being reworked from scratch.

Structured concurrency, seventh preview (JEP 533)

If you've written concurrent Java with ExecutorService and manual Future bookkeeping, you know the failure mode: one subtask throws, and without care, its siblings keep running, unjoined, leaking threads and doing wasted work nobody's waiting on anymore. Structured concurrency fixes this by making the scope the unit of lifetime — child tasks can't outlive the block that forked them.

Response handle() throws ExecutionException, InterruptedException {
    try (var scope = StructuredTaskScope.open()) {
        Subtask<String> user = scope.fork(() -> findUser());
        Subtask<Integer> order = scope.fork(() -> fetchOrder());
        scope.join(); // waits for both — or cancels the sibling if one fails
        return new Response(user.get(), order.get());
    }
}

open() accepts a Joiner that decides the scope's completion policy. Joiner.anySuccessfulOrThrow() gives you a race — first success wins, losers get cancelled:

<T> T race(Collection<Callable<T>> tasks)
        throws ExecutionException, InterruptedException {
    try (var scope = StructuredTaskScope.open(Joiner.<T>anySuccessfulOrThrow())) {
        tasks.forEach(scope::fork);
        return scope.join();
    }
}

Joiner.allSuccessfulOrThrow() gives you fan-out/fan-in — wait for every subtask, but cancel the rest the moment any one fails:

<T> List<T> runConcurrently(Collection<Callable<T>> tasks)
        throws ExecutionException, InterruptedException {
    try (var scope = StructuredTaskScope.open(Joiner.<T>allSuccessfulOrThrow())) {
        tasks.forEach(scope::fork);
        return scope.join();
    }
}

And you can attach a timeout and a custom ThreadFactory (virtual threads, almost always) to the same call:

<T> List<T> runConcurrently(Collection<Callable<T>> tasks,
                             ThreadFactory factory,
                             Duration timeout)
        throws ExecutionException, InterruptedException {
    try (var scope = StructuredTaskScope.open(
            Joiner.<T>allSuccessfulOrThrow(),
            cf -> cf.withThreadFactory(factory).withTimeout(timeout))) {
        tasks.forEach(scope::fork);
        return scope.join();
    }
}

A parent scope forking two subtasks in parallel — findUser and fetchOrder — joining on both, with an arrow showing that if one subtask throws, the scope automatically cancels the other before propagating the failure

Seven previews in, this is one of the more stable-feeling previews in the JDK right now — the shape (open, fork, join, Joiner) hasn't moved much release to release. It's a strong candidate to actually build against in a throwaway branch today, so the migration when it finalizes in a future LTS is closer to "delete the flag" than "relearn the API."

Primitive types in patterns, instanceof, and switch — fifth preview (JEP 532)

Pattern matching has covered reference types since Java 21; this JEP closes the gap for primitives, and it's a genuinely useful one for anything that does status-code or range-based dispatch:

switch (x.getYearlyFlights()) {
    case 0 -> bronzeTier();
    case 1, 2 -> issueDiscount();
    case int i when i >= 100 -> issueGoldCard();
    case int i -> defaultTier(i);
}

instanceof gets the same treatment, including narrowing conversions inside record patterns:

if (json instanceof JsonObject(var fields)
        && fields.get("age") instanceof JsonNumber(int age)) {
    processAdult(age);
}

And switch now accepts boolean and long labels directly, which used to require an if/else detour:

String message = switch (user.isLoggedIn()) {
    case true  -> "welcome back, " + user.name();
    case false -> "please sign in";
};

Lazy constants — third preview (JEP 531)

static final fields initialize eagerly, at class-init time, whether you ever touch them or not. LazyConstant gives you the same "compiler can treat this as a true constant and fold it" performance characteristic, but with initialization deferred to first access:

private static final LazyConstant<Logger> LOGGER =
        LazyConstant.of(() -> Logger.create(OrderController.class));

void submitOrder(User user, List<Product> products) {
    LOGGER.get().info("order started for {}", user.id());
}

There are lazy collection variants too — List.ofLazy, Map.ofLazy, Set.ofLazy — useful for per-thread or per-key resource pools you don't want built until something actually asks for that slot:

private static final List<OrderController> POOL =
        List.ofLazy(POOL_SIZE, _ -> new OrderController());

static OrderController forThread() {
    long index = Thread.currentThread().threadId() % POOL_SIZE;
    return POOL.get((int) index);
}

This is the direct answer to years of hand-rolled double-checked-locking lazy-init boilerplate — worth watching even though, at third preview, the API is more likely to still shift than structured concurrency is.

PEM encoding for cryptographic objects — third preview (JEP 538)

Java has had PEMEncoder/PEMDecoder-shaped gaps forever — everyone reads and writes PEM-formatted keys and certificates, and everyone's been doing it with either a third-party library (Bouncy Castle) or manual Base64 wrangling around -----BEGIN...----- markers. JEP 538 gives you a real API:

PEMEncoder encoder = PEMEncoder.of();
String pem = encoder.encodeToString(keyPair.getPrivate());
String encryptedPem = encoder.withEncryption(password).encodeToString(privateKey);

PEMDecoder decoder = PEMDecoder.of();
PrivateKey key = decoder.decode(pem, PrivateKey.class);
ECPrivateKey ecKey = decoder.withDecryption(password).decode(pem, ECPrivateKey.class);

For anything Java can't yet model as a typed object, PEM.class gets you the raw type tag and content instead of a parse failure:

PEM raw = PEMDecoder.of().decode(pem, PEM.class);
String type = raw.type();       // e.g. "PRIVATE KEY"
byte[] decoded = raw.decode();  // the Base64 content, decoded

If your codebase currently shells out to openssl or carries Bouncy Castle purely for PEM parsing, this is worth prototyping now — it's a small, self-contained surface, which usually means less churn before it finalizes.

Still incubating: the Vector API, twelfth round (JEP 537)

The Vector API — an API for writing vector computations that reliably compile down to SIMD instructions on the target CPU instead of relying on the JIT to auto-vectorize scalar code — is now on its twelfth incubation cycle. That's a long time in incubator, and it reflects how hard it is to expose a stable, portable API over hardware that varies this much. It's genuinely useful today if you're doing numerical or data-processing work that benefits from explicit vectorization, but "incubating" here means even more caution than "preview": expect real breaking changes between rounds, and don't build anything you can't easily rewrite.

What to actually do about all this

  • Treat the four final JEPs as "just upgrade and go." They cost you nothing to adopt, the two GC/memory changes are net wins for almost every workload, and the JFR redaction is a default security improvement you get for free. Benchmark the G1-everywhere change specifically if you run small-heap containers; otherwise there's nothing to decide.
  • Prioritize the upgrade if long-lived confidentiality matters to you. JEP 527's post-quantum TLS is the one JEP in this release with a real "the longer you wait, the more historical traffic is exposed" cost attached.
  • Use --enable-preview on a branch, not in production. Preview APIs are explicitly allowed to change shape between JEP rounds — JEP 538's PEM API and JEP 531's LazyConstant are both still evolving. Structured concurrency (JEP 533) is the safest bet to actually build real prototypes against, given how many previews it's already stabilized through.
  • Remember this is STS. If you're on an LTS train in production, Java 27 isn't the release you deploy — it's the release you use to de-risk Java 29. Every preview here either finalizes or gets cut before then; better to find out which on a side project than in a release retro.
javac --release 27 --enable-preview Main.java
java --enable-preview --source 27 Main.java

Java's six-month cadence means there will be a Java 28 in March 2027 before most teams have even upgraded off 21 or 25 — that's fine, and expected. The point of an STS release like this one was never "adopt it in production." It's "here's what's coming, six to twelve months before it's final — go find out if it actually solves your problem before you're forced to have an opinion about it."