Which Java Version Should You Run in 2027? Java LTS Versions Explained
- #Java
- #JDK
- #lts
- #upgrades
Short answer first, because it's the question people actually search for: Java 27 is not an LTS release. It shipped in September 2026 as a six-month feature release, and the free builds of it stop getting updates in the first half of 2027. If you're picking a Java version for production in 2027, pick Java 25, the current LTS. If you're already on Java 21, you're fine for now, but put the move to 25 on next year's plan.
The rest of this post is about why, because knowing how Java LTS versions and vendor support windows work is what lets you make the same call next year without looking it up again.
Is Java 27 an LTS release?
No. Java ships a new feature release every March and September. Every two years one of them is designated Long Term Support. The Adoptium project (the people behind Eclipse Temurin) puts it plainly on their support page: since 2021, one feature release every two years becomes an LTS, and they support each LTS for at least four years.
That gives you the sequence 17 (2021), 21 (2023), 25 (2025), and the next one, Java 29, expected in September 2027. Everything in between (22, 23, 24, 26, 27, and Java 28 next March) is a non-LTS release. Those still get security patches, but only until the next release lands. Amazon's Corretto support calendar lists Corretto 27's last planned update as January 2027 and its end of life as April 2027. Temurin 27's end of availability is March 2027. Corretto 26 already reached end of life in October 2026.
So "can I run Java 27 in production?" really means "will my team upgrade again within six months, every six months, forever?" Some teams genuinely can. Most can't, and for them Java 27 is a preview of Java 29, not a place to stay. (I wrote up what's new in Java 27 when it came out, if you want to know what it's previewing.)
The support windows, side by side
"LTS" isn't a promise made by Java itself. It's a promise each vendor makes about its own builds, and the dates differ. Here's what the two most common free distributions commit to right now, taken from their official pages in November 2026:
| Version | Type | Released | Corretto end of life | Temurin end of availability |
|---|---|---|---|---|
| 8 | LTS | 2014 | Dec 2030 | at least Dec 2030 |
| 11 | LTS | 2018 | Jan 2032 | at least Oct 2027 |
| 17 | LTS | Sep 2021 | Oct 2029 | at least Oct 2027 |
| 21 | LTS | Sep 2023 | Oct 2030 | at least Dec 2029 |
| 25 | LTS | Sep 2025 | Oct 2032 | at least Sep 2031 |
| 26 | non-LTS | Mar 2026 | Oct 2026 (ended) | Sep 2026 (ended) |
| 27 | non-LTS | Sep 2026 | Apr 2027 | Mar 2027 |
Two things in that table catch people out.
The same version can have very different end dates. Java 11 and 17 on Temurin are only promised until October 2027. On Corretto, 17 runs to 2029 and 11 to 2032. If you're on 11 or 17 and assuming "LTS means years left", check which build you actually ship in your Docker base image before you put that assumption in a roadmap.
Oracle's own JDK has a licensing dimension the others don't. Per Oracle's Java SE support roadmap, Oracle JDK 25 is free to use under the No-Fee Terms and Conditions, but updates released after September 2028 are planned to move to the paid OTN license. Oracle JDK 21's free period has already ended: updates from the October 2026 patch release onward come under the OTN license. Oracle's paid Premier Support runs much longer (to September 2030 for 25), but that's a contract, not a free download. If you run Oracle JDK without a subscription, your real end date is the end of the free-license window, not the end of support.
That's the main reason this blog defaults to Amazon Corretto: it's free, the LTS windows are long, and nobody has to read a license before patching. Temurin is an equally good choice. What matters more than the brand is that you know whose build you run and when it stops getting patches. Setting up your Java environment covers installing either one.
What changed between Java 21 and Java 25
If you're on 21, the upgrade to 25 is four feature releases' worth of change.
For application code, most of it is opt-in and pleasant. A few runtime
changes apply whether you ask for them or not. Everything below compiled and
ran on Corretto 25.0.4 with no --enable-preview flag.
Language and library features you can now use without flags
A lot of things that were "preview, maybe later" on 21 are final on 25:
import module java.base; // module import (JEP 511): no more ten java.util imports
record Order(String id, BigDecimal amount) {}
class PositiveAmount {
final BigDecimal amount;
PositiveAmount(BigDecimal amount) {
if (amount.signum() <= 0) { // validation before super() (JEP 513)
throw new IllegalArgumentException("amount must be positive");
}
super();
this.amount = amount;
}
}
public class Features {
static final ScopedValue<String> REQUEST_ID = ScopedValue.newInstance();
public static void main(String[] args) {
List<Order> orders = List.of(
new Order("a", new BigDecimal("10")),
new Order("b", new BigDecimal("25")),
new Order("c", new BigDecimal("7")),
new Order("d", new BigDecimal("40")),
new Order("e", new BigDecimal("3")));
// Stream gatherers (final in 24): fixed-size batches in one line
List<List<String>> batches = orders.stream()
.map(Order::id)
.gather(Gatherers.windowFixed(2))
.toList();
System.out.println(batches); // [[a, b], [c, d], [e]]
int count = 0;
for (Order _ : orders) count++; // unnamed variable (final in 22)
System.out.println("orders: " + count); // orders: 5
// Scoped values (final in 25): a safer ThreadLocal for request context
ScopedValue.where(REQUEST_ID, "req-42").run(() ->
System.out.println("handling " + REQUEST_ID.get()));
}
}
None of this changes how you design a service. It removes small annoyances.
Batching with a gatherer instead of a hand-rolled loop, validating constructor
arguments before calling super(), and passing request context through
virtual threads without ThreadLocal leaks are the three you'll probably
reach for first.
Small scripts and teaching examples also got simpler. A compact source file (JEP 512) needs no class declaration:
void main() {
IO.println("Hello from a compact source file on Java " + Runtime.version().feature());
}
java Hello.java runs it directly.
Runtime changes that matter more than the syntax
Virtual threads no longer get pinned by synchronized. This is the
biggest practical reason to move off 21 if you adopted virtual threads. On
Java 21, a virtual thread that blocked inside a synchronized block held on
to its carrier (platform) thread, so a few slow calls under a lock could
starve the whole scheduler. Since Java 24, it releases the carrier like any
other blocking call. A quick check:
try (var executor = Executors.newVirtualThreadPerTaskExecutor()) {
for (int i = 0; i < 1_000; i++) {
Object lock = new Object();
executor.submit(() -> {
synchronized (lock) {
Thread.sleep(Duration.ofMillis(100)); // blocks while holding a monitor
}
return null;
});
}
}
On a 12-core machine running Java 25 this finished in about 115 ms: all
1,000 sleeps overlapped. If each one pinned a carrier, only 12 could sleep at
once, and the same loop would need roughly 1,000 / 12 × 100 ms, around
eight seconds. If your Java 21 code has a "don't use synchronized with
virtual threads" rule in its style guide, Java 25 is where you can drop it.
An AOT cache for faster startup. You can record a training run and reuse the loaded and linked classes on every start afterwards:
java -XX:AOTCacheOutput=app.aot -jar app.jar # training run writes the cache
java -XX:AOTCache=app.aot -jar app.jar # later starts reuse it
It wants a jar on the classpath, not a directory of classes. Whether it pays off depends on how much of your startup is class loading. Measure your own service before and after rather than trusting someone else's benchmark.
Compact object headers are a product option (-XX:+UseCompactObjectHeaders),
no experimental unlock needed. On 25 you opt in. On 27 it's the default, so
trying it on 25 now is a cheap way to find out early whether anything in your
stack minds.
The Security Manager is gone for good. Calling
System.setSecurityManager on 25 throws UnsupportedOperationException,
and passing -Djava.security.manager=allow makes the JVM refuse to start.
Almost no application uses it today, but some old plugins and test harnesses
still do. Search your codebase and dependencies for it before the upgrade,
not during.
The decision rule
Most of the "which version" debate goes away once you separate two kinds of code.
Applications run the latest LTS and upgrade in planned windows. You
control the runtime, so take the newest supported one. Don't jump on day
one of a new LTS: give the .0 release a few months for the first patch
updates and for your frameworks, agents and build plugins to catch up. Then
schedule the move like any other piece of work, with an owner and a date, not
as something that happens when a CVE forces it.
Libraries support the lowest LTS their users run. If you publish a library (even an internal one shared by several teams), your users' oldest runtime is your floor. Build it with whatever JDK you like, but compile for that floor:
<properties>
<!-- compile for the oldest LTS your users run, whatever JDK builds it -->
<maven.compiler.release>17</maven.compiler.release>
</properties>
Built with JDK 25, that produces class files with major version 61, which
is Java 17. The release flag also checks API usage, so accidentally calling
a Java 21 method fails the build instead of failing at your users' runtime.
(If maven.compiler.release is new to you,
Maven vs. Gradle explained
covers how the compiler plugin fits into the build.) Then run your test
suite on both the floor and the newest LTS in CI, so you hear about breakage
before your users do. This is the same approach Spring takes: Spring
Framework 6 and 7 both keep Java 17 as the minimum while supporting the
latest JDKs.
So, concretely, in 2027
- On Java 8 or 11: go straight to 25. Upgrading to 17 or 21 first means
doing the migration twice. The
javaxtojakartamove and old library versions are the hard part, not the JDK version, so budget for them. On Spring Boot 2.7, the 2.7 to 3.x checklist covers that part. - On Java 17: plan 25 for 2027. Temurin only promises 17 until at least October 2027. Corretto runs longer, but staying on 17 also keeps you on older framework lines.
- On Java 21: you have time, with Corretto to 2030 and Temurin to at least the end of 2029. Still, schedule 25 in 2027. Waiting for 29 means a bigger jump later for no real gain, and the pinning fix alone is worth it if you use virtual threads. If you run Oracle JDK 21 without a subscription, this is more urgent: its free updates have already ended.
- On Java 25: stay there through 2027. Try Java 29 when it ships in September 2027, and plan the production move for 2028.
- On Java 26 or 27 in production: only if your team really upgrades every six months. Java 26 is already out of free support on Corretto and Temurin, and 27 follows in spring 2027.
Whatever you run, check java -version on a real production host instead
of the Dockerfile you think is deployed. An LTS build says so in the version
string (25.0.4.1+10-LTS on current Corretto), and it's the quickest way to
find the one service still quietly running something else.