java-migration

Guides upgrading Java projects across LTS versions with breaking-change fixes and framework migrations.

Updated Apr 20, 2020
One-click install
npx skills add https://github.com/UnterrainerInformatik/java-rdb-utils --skill java-migration-unterrainerinformatik
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: java-migration
Source: https://github.com/UnterrainerInformatik/java-rdb-utils/tree/main/.agents/skills/java-migration
Command: npx skills add https://github.com/UnterrainerInformatik/java-rdb-utils --skill java-migration-unterrainerinformatik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Upgrading Java between major LTS versions (8→11→17→21→25) involves removed APIs, module system restrictions, and framework incompatibilities that cause compilation failures and runtime errors. This Skill provides step-by-step migration paths with concrete fixes for each breaking change. ## Core Features & Use Cases - Version-by-version migration guides: Covers Java 8→11→17→21→25 with tables of removed APIs, replacement dependencies, and new language features to adopt. - Framework migrations: Handles Spring Boot 2.x→3.x (javax.* to jakarta.* renames) and Hibernate 5→6 query API changes, including OpenRewrite automation commands. - Troubleshooting reference: Diagnoses common issues like InaccessibleObjectException, JAXB ClassNotFoundException, and outdated Lombok/Mockito versions with exact fixes. - Use Case: A team needs to move a Spring Boot 2.7 application from Java 11 to Java 21. The Skill walks them through updating the Maven compiler config, adding Jakarta dependencies, fixing javax imports, and running tests. ## Quick Start Ask the assistant to upgrade this project from Java 11 to Java 21 and list all breaking changes that need fixing.

Frequently Asked Questions about java-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I upgrade a Java project from Java 8 to Java 11?▼

Update the Maven compiler source/target to 11, then add Jakarta dependencies for removed APIs like javax.xml.bind (JAXB) and javax.annotation. Use grep to find sun.* internal API usage and add --add-opens flags if reflection on JDK internals fails.

How to migrate Spring Boot 2.x to Spring Boot 3?▼

Spring Boot 3 requires Java 17+ and renames javax.* packages to jakarta.* for persistence, validation, and servlet APIs. Use OpenRewrite with the UpgradeSpringBoot_3_0 recipe to automate the migration, then update Hibernate to version 6.

What breaks when upgrading from Java 21 to Java 25?▼

Java 25 removes the Security Manager, removes sun.misc.Unsafe methods, drops 32-bit platform support, and restricts dynamic agent loading. Replace Unsafe with VarHandle or the FFM API, and add -XX:+EnableDynamicAgentLoading if agents are used.

Why does reflection fail with InaccessibleObjectException after upgrading Java?▼

Strong encapsulation in Java 17+ blocks reflective access to JDK internals by default. Fix it by adding --add-opens flags such as --add-opens java.base/java.lang=ALL-UNNAMED to the JVM or Maven Surefire argLine configuration.

Does Spring Boot 2.7 work with Java 21 or Java 25?▼

Spring Boot 2.7 supports Java 8 through 17, with only partial compatibility on Java 21 and no support for Java 25. For Java 21 or 25, upgrade to Spring Boot 3.2 or later, which requires Java 17 as a minimum.

How do I fix javax.xml.bind ClassNotFoundException after Java upgrade?▼

JAXB was removed from the JDK in Java 11. Add the jakarta.xml.bind-api dependency plus the jaxb-runtime implementation to your Maven pom.xml to restore the missing classes.