Signs it is time

  • The application still runs on Java 8 or 11, and a newer JDK breaks the build.
  • It depends on Spring Boot 2, Karaf/OSGi, or an application server nobody wants to touch.
  • Security scanners flag libraries you cannot update without updating everything else.
  • New developers need days to get the project running locally.

What usually has to change

  • JAXB, JAX-WS and other modules removed from the JDK come back as explicit dependencies.
  • The javax.* namespace becomes jakarta.* for Spring Boot 3 and current Jakarta EE.
  • Build plugins, test libraries, and bytecode tools need versions that understand Java 21.
  • Code and libraries that reach into JDK internals by reflection need replacing or explicit access.

How I approach it

  • Inventory first. I map the modules, dependencies, and runtime assumptions, and note which parts have tests and which do not.
  • A reproducible build. Before any upgrade, the project has to build and run the same way on every machine and in the pipeline.
  • Upgrade in stages. Dependencies, frameworks, and the JDK move in deployable steps rather than in one long branch that never merges.
  • Tests where the risk is. I add tests around the code the upgrade touches most, instead of chasing a coverage number.
  • Delivery continues. Feature work and bug fixes carry on during the migration. On SIB-BW2 they run alongside it.

The order I upgrade in

  • Build tooling first. Compiler, test, and bytecode plugins move to versions that understand Java 21, while the code still targets Java 8.
  • Tests on a Java 21 runtime. The code still compiles for Java 8, but the tests run on JDK 21. That separates code that no longer compiles from code that behaves differently.
  • Restore what the JDK removed. The removed modules come back as explicit dependencies, one at a time, with the tests run after each.
  • Fix reflective access. Usually by upgrading the old library that reaches into JDK internals. I treat --add-opens flags as a list to shrink, not as the fix.
  • Move the framework. Spring Boot 3 and the jakarta.* namespace. On Karaf or an application server, this is also where the runtime changes.
  • Switch the release target to 21. By now the application already runs on Java 21, so this step should change little.

How I test an upgrade

  • Compare report output. Every report and export is generated from fixed test data before the upgrade and compared after each step. This catches locale, rounding, and library changes that unit tests miss.
  • Test against the real database. Driver and Hibernate upgrades change the SQL they generate. A test on an in-memory database will not show a change that only happens on Oracle or SQL Server.
  • Start the packaged application. A smoke test starts the real build with its real configuration and calls a few endpoints. Framework moves fail at startup more often than in business logic.
  • Run both JDKs in the pipeline. While some environments still run Java 8, the pipeline tests on 8 and 21.

Current project: SIB-BW2

SIB-BW2 manages street infrastructure for a German state administration. I work on its move from Java 8/Karaf to Java 21/Spring Boot, built about 30 of its reports, and developed the migration tool that moves thousands of structures (Bauwerke) to the ASB-ING standard as needed. The JDK was the small part. Moving more than 20 Maven modules off Karaf, and getting the MapStruct mappings working again, took most of the time.

Java upgrades are one part of my work. I also build reporting, integrations, internal tools, and AI workflows, in the backend and the frontend.

See all services

What you get

  • A written inventory of the runtime, dependencies, and risks, with an upgrade order
  • The upgraded application, deployed in stages
  • Tests around the code the upgrade changed
  • Documentation of what changed, and how to build, run, and release the application

When I would advise against it

  • The application will be replaced within a year anyway.
  • It is small enough that rebuilding it on a current stack costs less than upgrading it.

Questions about Java upgrades

Do we have to go through Java 11 and 17 first?
Not necessarily. The JDK can often move straight to 21, but libraries and frameworks usually move in stages because each has its own breaking changes. The inventory decides the order.
Do we need Spring Boot 3?
If the application uses Spring Boot 2, yes, eventually: version 2 no longer receives open-source updates. Spring Boot 3 requires Java 17 or later and the jakarta.* namespace, so it is usually part of the same project.
Can the system stay in use during the migration?
Yes. That is the point of upgrading in stages. Each stage is deployed and checked before the next one starts.
What about applications on Karaf/OSGi or an application server?
They need one more step: moving to a runtime that current frameworks support, usually Spring Boot with an embedded server. That is the move I am making on SIB-BW2.

Have a process or software problem worth checking?

A short conversation is enough to decide whether an audit, a small build, or no custom software is the right next step.