01Decision first
Should you target Java 21 or Java 25?
Target Java 25 if your frameworks and vendors already support it and you are starting a project now. Target Java 21 if a vendor, a build plugin or a platform team has only certified 21. Either way, the hard part is the same: getting off Java 8 or 11. See the Java upgrade service for how that work is run.
Do not wait for a perfect moment. The jump from 8 to 17 is where applications break. The step from 17 to 21 or 25 is usually smaller.
| Your situation | Target | Why |
|---|---|---|
| On Java 8, frameworks current | 21 or 25 | Same migration work; pick the newest your vendors certify |
| On Java 11, Spring Boot 2.x | 21 or 25 | Spring Boot 3 needs 17 or higher anyway |
| Vendor product certified only to 17 or 21 | The certified version | Support matters more than features |
| Greenfield service | 25 | Longest remaining support window |
02Background
What does LTS mean here?
Oracle ships a new Java feature release every six months. Only some are designated long-term support, and vendors publish security updates for those for years. Java 8, 11, 17, 21 and 25 are LTS releases. The releases between them are supported for about six months.
For enterprise planning, that means you upgrade from one LTS to the next and skip the rest. Several vendors, including Oracle, Red Hat and Eclipse Temurin distributors, publish their own support terms. Check each vendor's current lifecycle page before you commit to a date.
03Features
Which Java 25 features matter for an enterprise upgrade?
Java 25 gathers everything shipped since Java 21, plus its own additions. These are the ones that change how you operate or write code. Each JEP number is listed so you can read the original proposal.
| Feature | JEP | Why an upgrade team cares |
|---|---|---|
| Scoped values | 506 | A cleaner alternative to thread-local state, designed for virtual threads |
| Compact object headers | 519 | Can cut heap use; you measure it on your own workload |
| Generational Shenandoah | 521 | A garbage collector option for latency-sensitive services |
| Flexible constructor bodies | 513 | Lets you run checks before calling super(...) |
| Module import declarations | 511 | Shorter imports; mostly a new-code convenience |
| Compact source files and instance main | 512 | Simpler entry points for scripts and teaching; not an upgrade driver |
| Remove the 32-bit x86 port | 503 | Only matters if you still run 32-bit x86 |
04Risk
What still breaks when you move up?
- Removed Java EE modules (JAXB, JAX-WS and others) that left the JDK in Java 11. Add them back as libraries.
- Strong encapsulation of JDK internals since Java 17. Libraries that use reflection into java.base fail with InaccessibleObjectException.
- The Security Manager is permanently disabled in recent releases. Code that relies on it needs a different control.
- Bytecode tools and agents built for older class file versions. Update ASM, Byte Buddy, Mockito and your APM agent first.
- Application servers that are not certified for the new version.
05Our test
What are we measuring on a real upgrade?
We are running a sample-repository upgrade from Java 8 to 21 and 25 using OpenRewrite recipes and AI-assisted tools, with engineer review. We will record build breaks by category, recipe coverage, time to green tests and what a human had to fix. Results will be published here. This test is in progress.
06Next step
How does Ace8 help with a Java upgrade?
Ace8 is the AI-assisted application modernization practice of AceMQ. We run recipes first, use AI-assisted tools on what remains, and an engineer reviews every change against tests.
To choose between 21 and 25 for your estate, start with the modernization assessment. It lists your Java versions, framework versions and vendor constraints, then proposes a target. The Java upgrade page describes the delivery.