Java 25 and Spring Boot 4 Migration: A Field Guide to the Silent Breakages
Spring Boot 4 and Java 25 are landing in production, and the upgrade is full of silent behavior changes that compile cleanly and break at runtime - Flyway no longer auto-configures, Jackson 3 flips date formats, and several JEPs get misattributed to the wrong JDK version. Teams upgrading now need this kind of verification-first checklist to avoid weeks of debugging.
A developer's week-long upgrade of two services from Java 21 to 25 and Spring Boot 3.5 to 4.1 looks smooth on the surface - compilation passes, startup succeeds - but the real cost is in runtime behavior changes that don't announce themselves. The article's central discipline is changing one variable at a time: first JDK, then Boot, so any regression can be attributed to one layer. That decision alone saved days of debugging.
On the JDK side, the upgrade yields real benefits like Scoped Values becoming final (with a breaking change in `orElse`) and virtual threads no longer pinning, but the traps are in compatibility: `sun.misc.Unsafe` deprecation, the removal of `--illegal-access`, and a pile of JEPs that online articles misattribute to JDK 25 when they actually belong to JDK 26. The Boot 4 upgrade is dominated by modularization: auto-configuration splits into per-starter modules, which means Flyway stops running unless you switch to `spring-boot-starter-flyway`, and Jackson 3's immutable `JsonMapper` changes date serialization to ISO-8601 by default, silently breaking contracts with downstream systems.
The article offers a practical verification checklist: diff real API responses before and after, verify database migrations at three levels, search for removed keywords, and review OpenRewrite's automated edits rather than trusting them. It also maps version coupling for Spring AI (2.0 requires Boot 4.0/4.1; 2.1 requires 4.2) and warns against relying on second-hand support matrices.
The upgrade's true cost is in silent behavior changes, not compile errors; the author's habit of diffing real API responses before and after is the only reliable way to catch them.
Splitting the JDK and Boot upgrades into separate commits isolates variables so precisely that any regression points to one layer; this should be a standard practice for major framework migrations.
Version misinformation is rampant: three widely repeated claims (Boot 4 requires Java 21, JEP 517 in JDK 25, structured concurrency final in 25) all turned out false when checked against official sources, underscoring that primary documents beat blog posts.
Boot 4's modularization is a long-overdue haircut for autoconfigure bloat, but it pushes complexity onto developers who must now know exactly which starter provides which behavior, or face silent gaps like Flyway.
Did you use an agent to assist with this work?