Spring Boot 3.x: What Actually Changed (And What to Do About It)
import Post from ’../../layouts/Post.astro’; export const prerender = true;
Spring Boot 3.0 dropped in November 2022. If you haven’t touched it yet, here’s what actually changed — and what it means for your apps in 2026.
The Breaking Changes That Matter
Java 17 Minimum
This is the biggest one. If you’re on Java 11 or Java 8, you can’t upgrade without migrating your runtime first.
<!-- Spring Boot 2.x -->
<java.version>11</java.version>
<!-- Spring Boot 3.x -->
<java.version>17</java.version>
Why it matters: Java 17 LTS gives you records, sealed classes, pattern matching, and the ZGC garbage collector. If you’re still on Java 8 in 2026, you’re 3 major versions behind and missing significant language improvements.
Jakarta EE 9+
Package rename: javax.* → jakarta.*. Every Spring import and annotation namespace changed.
// Before (Spring Boot 2.x)
import javax.persistence.Entity;
import javax.validation.constraints.NotNull;
// After (Spring Boot 3.x)
import jakarta.persistence.Entity;
import jakarta.validation.constraints.NotNull;
Migration path: IntelliJ has a bulk refactor tool. For a medium-sized codebase: 30-60 minutes.
What’s Actually Good
Virtual Threads (Project Loom)
@RestController
public class AsyncController {
@GetMapping("/slow")
public String slowEndpoint() throws InterruptedException {
// This no longer blocks a platform thread
// ~1M virtual threads per server instead of ~200
Thread.sleep(2000);
return "done";
}
}
Enable with: spring.threads.virtual.enabled=true in application.properties. Your existing code just gets better.
Native Images with AOT
Spring Boot 3 + GraalVM = instant startup, lower memory:
# Build native image
./mvnw native:compile -Pnative
# Result: 80MB binary, starts in 50ms instead of 3s
This changes the economics of microservices. Cold start不再是问题.
Records in Spring
// Instead of a Lombok @Data class
public record CreateUserRequest(
@NotBlank String username,
@NotBlank @Email String email,
@NotNull Integer age
) {}
Less boilerplate. Immutability by default. Works perfectly with @RequestBody validation.
What Didn’t Change
- The programming model —
@RestController,@Service,@Repositoryall still work - Spring Data JPA — same annotations, same queries
- Spring Security — configuration DSL evolved but concepts are the same
- Actuator, WebClient, etc. — all still there
Should You Migrate?
| Situation | Recommendation |
|---|---|
| New project | Use Spring Boot 3.x immediately |
| Java 17 already in prod | Migrate — the benefits are real |
| Java 11 in prod | Upgrade Java first, then Spring |
| Java 8 in prod | This is a bigger migration — consider if it’s worth it |
| Monolith with no scaling issues | Stay on 2.7.x LTS until it EOLs (2025) |
The Bottom Line
Spring Boot 3 is not a revolution — it’s a maturation. The move to Java 17 minimum forces overdue upgrades. Virtual threads and AOT compilation are genuine improvements. The jakarta.* migration is tedious but not hard.
If you’re starting a new project in 2026: Spring Boot 3.x, no question. If you’re maintaining a 2.x app: plan the migration, but don’t rush.
Enjoying the content? Here are tools I personally use and recommend:
- 🌐 Hosting: Bluehost — what this blog runs on
- 🛒 Tech Gear: My Amazon Store — keyboards, monitors, dev tools I use
Purchases through my links help keep this blog ad-free 💙
Enjoyed this post?
Subscribe to the newsletter or follow on YouTube for more dev content.
🎬 Watch Shorts