Java upgrade
Java upgrade: from Java 8 or 11 to Java 21.
What breaks, what a recipe can fix, and what needs a person. A guide for the developer and a plan for the manager.
The short answer
A Java upgrade moves your applications from Java 8 or 11 to a current long-term support release such as Java 21. Most of the effort is removed APIs, stricter module encapsulation and dependency updates. Ace8 runs OpenRewrite recipes for the bulk changes, tests the result and has an engineer review each diff.
Reasons
Why upgrade
- Older runtimes stop receiving free security updates, and open CVEs pile up.
- Current Spring versions need Java 17 or later, so the framework upgrade depends on it.
- Libraries drop old Java versions every year. The longer you wait, the bigger the jump.
- AI features, agents and modern tooling target current runtimes.
Breaking changes
What breaks
These are the classes of breakage we look for. Check each against the release notes of the exact versions you are crossing.
| Change | Appears from | Symptom | Usual fix |
|---|---|---|---|
| Java EE modules removed from the JDK, including JAXB and JAX-WS | Java 11 | Compile errors on javax.xml.bind and related imports | Add the dependency explicitly, or move to the Jakarta equivalent |
| Nashorn JavaScript engine removed | Java 15 | Runtime failure where scripts use the engine | Replace with another engine or rewrite the script step |
| Strong encapsulation of JDK internals | Java 17 | Illegal reflective access errors | Upgrade the library, or add targeted --add-opens flags as a stopgap |
| Library version floors | Throughout | Old library will not run on the new JDK | Bump the dependency and fix its API changes |
| Build tool and plugin versions | Throughout | Compiler or test plugin fails | Update Maven or Gradle and plugins |
Evidence
Recipe run on our sample repo
We run the OpenRewrite Java 21 upgrade recipe on an open-source Java 8, Spring Boot 2 and javax application. For each class of breaking change we will report how many occurrences the run found and fixed, and the test results before and after. The run is not published yet, so no numbers appear here. See OpenRewrite.
Beyond the code
Build, test and CI changes
A recipe changes source and build files. It does not change the environment around them.
- CI images and build agents need the new JDK.
- Container base images and runtime flags change.
- Test frameworks and mocking libraries often need a version bump.
- Static analysis and code coverage tools must support the new bytecode.
- Monitoring agents must support the new runtime.
Route
Upgrade path: 8 to 11 to 17 to 21
You can jump straight to 21, but you then meet every change at once. Stepping through 11 and 17 isolates each group of failures, at the cost of more test cycles. We choose per application using its test coverage: well-tested code can jump, thinly tested code steps.
- 1
Java 8 to 11
Removed Java EE modules and early module-system effects.
- 2
Java 11 to 17
Strong encapsulation and library compatibility.
- 3
Java 17 to 21
Usually the smoothest step, once 17 is clean.
Cost
Effort factors
- Test coverage, because missing tests mean slow and uncertain review.
- Number of applications and shared libraries.
- Age and number of third-party dependencies.
- Use of reflection, bytecode tools and native code.
- How far apart the source and target versions are.
If you cannot yet
If the upgrade must wait
Some teams cannot upgrade this quarter. OSSeva provides extended support for Java 8 and 11 so you can stay on the old runtime safely while you plan. It is a bridge. The plan still ends at a current release.
After go-live
Keep it running after cutover.
Java 21 is the current target we plan for, since it is a long-term support release. Java 17 is the minimum for Spring Boot 3. We confirm the right release for you in the assessment.
Mainly removed Java EE modules such as JAXB, stricter encapsulation of JDK internals, and libraries that need newer versions. Tests find the rest.
It does the bulk of the mechanical edits. Build, CI, configuration and behavior changes still need an engineer and a test run.
Not always. But Spring Boot 3 needs Java 17 or later, so the Java upgrade usually comes first.
Yes, with extended support from OSSeva while you plan.
Know the cost before anything moves.
A fixed-price assessment gives you the inventory, the risk score and a phased plan. Scope and cost are fixed before the migration starts.
Book a Fixed-Price AssessmentGet in touch
Talk to a modernization engineer
Tell us what you run today. An engineer, not a sales script, replies within one business day.