Skip to content
← All insights
Java5 min read

Approaching Java and JDK upgrades safely

A JDK upgrade should be ordinary maintenance. Here’s how to stop it becoming an event.

The runtime reaches further than the code

A new JDK can uncover assumptions in libraries, build plugins, container images and production flags. A clean compile is encouraging; it is not proof that the service is ready.

Build confidence one step at a time

Update the tooling, compile cleanly, run tests that represent real behaviour, then watch the service in a production-like environment. Keep unrelated refactoring out of the upgrade.

  • Check which framework versions support the JDK
  • Look for removed flags and modules
  • Exercise startup and graceful shutdown
  • Compare memory, latency and CPU under load
Make the target JDK explicit in Mavenxml
<properties>
  <maven.compiler.release>21</maven.compiler.release>
</properties>

<plugin>
  <artifactId>maven-enforcer-plugin</artifactId>
  <!-- fail early when CI uses the wrong JDK -->
</plugin>