Why and How to Upgrade to Java 17 (and Prepare for 21)
summary
Explains concrete upgrade steps: compile, run unit tests, package, run; use Docker for multiple JDKs; upgrade dependencies (often only lombok and test libs needed — five projects upgraded with few code changes). Lists breakages and fixes: strong encapsulation of JDK internals, use of --add-opens or upgrade libs, Mojito/ByteBuddy fix, Nashorn/JavaFX removed, JMC split out, missing fonts on Alpine. Notes class file majors: 61 => Java 17, 65 => Java 21, and recommends openrewrite and Dependabot/Renovate.
AI-written summary · about
chapters (23)
- 0:00Introduction and motivation
- 2:24Reasons to upgrade Java
- 3:48Multi-release JARs explained
- 6:15Handling JDK internals changes
- 9:24Java 18 to 21 changes
- 11:12Class file version errors
- 12:41Automating upgrades with OpenRewrite
- 15:52Dependency and tool readiness
- 17:16Upgrading dependencies efficiently
- 20:44Step-by-step upgrade process
- 23:13Removed Java EE and CORBA modules
- 24:36Strongly encapsulated JDK internals
- 26:46Convincing management to upgrade
- 33:55Real-world upgrade challenges
- 37:24Resources for Java upgrades
- 39:11Testing with Docker
- 41:39Maven and Gradle configurations
- 44:25Compiling and testing steps
- 51:48Java 17 specific changes
- 54:38Finalization deprecation
- 57:33Using new Java 17 features
- 57:55OpenRewrite for code modernization
- 1:01:46Summary and next steps
