java-upgrade
Helps your agent update Java projects to newer versions, adopting new features. It's useful for modernizing code and taking advantage of modern features.
What it does
Helps upgrade your Java project to a newer Java version (like from 11 to 17). It guides you step-by-step to safely use new language and library features.
When to use it
- ✓When you want to update your Java code to a newer version.
- ✓When modernizing features in your Java project.
- ✓To adopt new Java features like 'records' or 'sealed classes'.
Example of what to ask your AI
“I want to upgrade my Java project from 11 to 17 and use the new features.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The AI checks which Java version your project uses and guides you through the necessary changes, one version at a time. It suggests updates to the build system and then helps incorporate new language features.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add github/awesome-copilot --skill java-upgradeOr download just the file:
curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/java-upgrade/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Java Upgrade
Help upgrade a Java project step by step and adopt new language features safely.
Need a more powerful, automated upgrade?
The Microsoft plugin modernize-java ("GitHub Copilot modernization - Java Upgrade CLI Plugin", also listed in this repository's plugins/external.json) upgrades Java applications from the command line. It can:
- analyze the project, assess dependencies and generate a customizable upgrade plan you can review and edit;
- execute the plan to automatically transform the codebase;
- fix build issues and resolve migration errors during the upgrade, running test validations;
- validate the application against known CVEs after the upgrade;
- output a detailed summary (file changes, updated dependencies, test results, remaining issues) suitable for PRs or CI logs.
This skill provides lightweight, step-by-step guidance and works without the plugin; the plugin is the more powerful option for large or multi-step upgrades. It is a separate Microsoft plugin, not part of this repository's skills. To try it (see the plugin README for the recommended model):
npm install -g @github/copilot
copilot plugin marketplace add microsoft/modernize-java
copilot plugin install modernize-java@modernize-java
copilot --agent modernize-java:modernize-java
Workflow
- Detect the current and target versions. Read
pom.xml(maven.compiler.release,java.version, toolchains),build.gradle*(java.toolchain,sourceCompatibility) and CI files. Never assume a target: ask the user if it is not stated. - Upgrade one LTS at a time (11 → 17 → 21 → 25). Build and run the tests after each step.
- Load only the guide you need from the table below. Do not load all of them.
- Update the build first (compiler release, plugins, dependencies that need newer versions), then adopt language features incrementally in small, reviewable changes.
- Verify:
./mvnw verifyor./gradlew build, and fix deprecation and removal warnings before adopting new features. - Automate and check upstream. Use OpenRewrite when available (for example
org.openrewrite.java.migrate.UpgradeToJava21) and always fetch the version-specific official guide before editing; review the generated diff.
Upstream sources (read before upgrading)
Fetch the page for the target version; prefer it over this skill when they conflict. Full list with build-tool and agent compatibility pages: references/upstream-sources.md.
- OpenJDK release page: https://openjdk.org/projects/jdk/21/ (change the number) and JEP index https://openjdk.org/jeps/0
- Oracle migration guide: https://docs.oracle.com/en/java/javase/21/migrate/getting-started.html
- Oracle release notes: https://www.oracle.com/java/technologies/javase/21-relnote-issues.html
jdeprscan/jdeps: https://docs.oracle.com/en/java/javase/21/docs/specs/man/jdeprscan.html, https://docs.oracle.com/en/java/javase/21/docs/specs/man/jdeps.html- Gradle compatibility matrix: https://docs.gradle.org/current/userguide/compatibility.html
- OpenRewrite: https://docs.openrewrite.org/recipes/java/migrate/upgradetojava21
Per-version guides
| Upgrade | Guide |
|---|---|
| Java 11 → 17 | references/java-11-to-17.md |
| Java 17 → 21 | references/java-17-to-21.md |
| Java 21 → 25 | references/java-21-to-25.md |
Rules
- Prefer behavior-preserving refactorings; do not change public APIs unless asked.
- Detect the project's frameworks (Spring Boot, Quarkus, Jakarta EE) and check their minimum supported Java version before raising the target.
- Do not adopt preview features unless the user opts in and the build enables them explicitly.
- For
javax.*tojakarta.*namespace changes, use thejavax-to-jakarta-migrationskill if it is installed (gh skills install github/awesome-copilot javax-to-jakarta-migration); otherwise do the migration inline: update imports,META-INFservice files and XML descriptors, and bump dependencies to Jakarta EE 9+ equivalents. - If the
modernize-javaplugin is installed and the user wants an automated upgrade, defer to it and use this skill for the per-version guides and thejavaxtojakartasafeguards.
FAQ
What's the difference between this skill and the 'modernize-java' plugin?
This skill offers a simpler step-by-step guide. The 'modernize-java' plugin is a more powerful tool for automatic and complex upgrades, which can be installed separately.
What are 'records' and 'sealed classes'?
'Records' are a simplified way to create classes that hold data. 'Sealed classes' allow you to control which other classes can inherit from a specific class.
Can I skip Java versions?
It's not recommended. The AI suggests upgrading one major version at a time (e.g., from 11 to 17, then 17 to 21) to ensure everything works correctly.
Details
Original description by the author
Upgrade a Java project to a newer JDK (11 to 17, 17 to 21, 21 to 25) and adopt the new language and library features. Detects the current Java version from the build files, then loads only the matching per-version guide. Use when the user asks to upgrade Java, modernize Java code, or adopt records, sealed classes, pattern matching, virtual threads or other new Java features. For automated end-to-e
repo: github/awesome-copilot
Popularity
- GitHub stars
- 40k
- Ranking position
- #5204
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
Helps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
github/awesome-copilot
acreadiness-assess
Enables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
github/awesome-copilot
acreadiness-generate-instructions
Helps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
github/awesome-copilot
acreadiness-policy
Enables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
github/awesome-copilot
Similar skills
api-connector-builder
Has your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
affaan-m/ECC
api-design
Helps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
affaan-m/ECC
backend-patterns
Helps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.
affaan-m/ECC