javax-to-jakarta-migration
What it does
This tool helps update your Java code by replacing old packages (javax.*) with newer ones (jakarta.*). This is necessary to use newer versions of technologies like the Tomcat web server or the Jakarta EE framework.
When to use it
- βWhen you want to use Tomcat 10+ or Jakarta EE.
- βWhen a Java or Spring Boot upgrade tool suggests this migration.
- βWhen you explicitly ask to migrate from 'javax' to 'jakarta'.
Skill link
https://github.com/github/awesome-copilot/blob/main/skills/javax-to-jakarta-migration/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βUpdate my Java code to use the Jakarta EE namespace.β
5 new skills a week. 1 minute to read.
How it works
The tool finds and replaces 'javax.*' packages with 'jakarta.*' in your code files and configurations. It also updates your project's dependencies to the correct Jakarta EE versions.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
javax β jakarta Migration Skill
When to Use
- The user explicitly asks to migrate to the jakarta namespace, Tomcat 10+/11 or Jakarta EE
java-upgradeorspring-boot-4-migrationdelegates the namespace migration
Detecting javax.* imports alone does not authorize this migration; report them instead.
In Spring Boot projects, the Boot BOM manages Jakarta versions: do not pin the versions below, and let the Boot version decide the Jakarta EE level (Boot 4 = Jakarta EE 11, Servlet 6.1). The examples below target Jakarta EE 10 (Servlet 6.0, Tomcat 10.1+) in non-Boot projects.
Procedure
Step 0 β Baseline
Run ./mvnw verify or ./gradlew build first and record the result; do not migrate on a red baseline. Make the change in a dedicated commit/step.
Step 1 β Scan for javax Usage
Search the codebase for all javax.* imports that need migration:
javax.servlet.* β jakarta.servlet.*
javax.persistence.* β jakarta.persistence.*
javax.validation.* β jakarta.validation.*
javax.annotation.* β jakarta.annotation.*
javax.inject.* β jakarta.inject.*
javax.enterprise.* β jakarta.enterprise.*
javax.faces.* β jakarta.faces.*
javax.ws.rs.* β jakarta.ws.rs.*
javax.el.* β jakarta.el.*
javax.json.* β jakarta.json.*
javax.mail.* β jakarta.mail.*
javax.websocket.* β jakarta.websocket.*
Do NOT migrate these (they remain in javax.*):
javax.sql.*β part of JDKjavax.naming.*β part of JDK (JNDI)javax.crypto.*β part of JDKjavax.net.*β part of JDKjavax.security.auth.*β part of JDKjavax.swing.*,javax.xml.parsers.*β JDK packages
Step 2 β Update pom.xml
Replace dependency coordinates. Choose API versions that match the target runtime; the table below is for Jakarta EE 10 (Tomcat 10.1+, Servlet 6.0):
| Target runtime | Jakarta EE | Servlet | Persistence | Validation | Annotations |
|---|---|---|---|---|---|
| Tomcat 10.0 | 9 | 5.0 | 3.0 | 3.0 | 2.0 |
| Tomcat 10.1 | 10 | 6.0 | 3.1 | 3.0 | 2.1 |
| Tomcat 11 | 11 | 6.1 | 3.2 | 3.1 | 3.0 |
| Old | New |
|---|---|
javax.servlet:javax.servlet-api |
jakarta.servlet:jakarta.servlet-api:6.0.0 |
javax.persistence:javax.persistence-api |
jakarta.persistence:jakarta.persistence-api:3.1.0 |
javax.validation:validation-api |
jakarta.validation:jakarta.validation-api:3.0.2 |
javax.annotation:javax.annotation-api |
jakarta.annotation:jakarta.annotation-api:2.1.1 |
Step 3 β Update web.xml (if present)
The version must match the target Servlet level (5.0 for Tomcat 10.0, 6.0 for Tomcat 10.1, 6.1 for Tomcat 11); the example below is for Servlet 6.0:
<!-- Old namespace -->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="4.0">
<!-- New namespace -->
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" version="6.0">
Step 4 β Update Java Source Files
Replace only the Jakarta EE javax. imports identified in Step 1 with their jakarta. equivalents in .java files; leave JDK packages (for example javax.sql, javax.crypto) unchanged. Also check non-Java references: persistence.xml (javax.persistence.* properties), META-INF/services, beans.xml, properties/YAML, string class names and reflection.
Step 5 β Verify
- Run
mvn clean compileorgradlew buildβ fix any compilation errors - Run
mvn testorgradlew testβ ensure all tests pass - Search for any remaining
javax.*imports (excluding JDK packages)
Upstream sources (read before migrating)
Fetch the page for the target version; prefer it over this skill when they conflict.
- Jakarta EE specifications: https://jakarta.ee/specifications/
- Eclipse Transformer (binary/bytecode transformation): https://github.com/eclipse-transformer/transformer
- OpenRewrite
org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta: https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxmigrationtojakarta - Tomcat 9 to 10 migration: https://tomcat.apache.org/migration-10.html
- Hibernate migration guides: https://hibernate.org/orm/documentation/migrate/
- Spring Boot 3 upgrade (Jakarta EE 9+ baseline): https://docs.spring.io/spring-boot/upgrading.html
Output
Provide a migration summary listing all files changed, imports replaced, and any manual steps required.
FAQ
Which 'javax.*' packages should NOT be migrated?
Packages that are part of the JDK (Java Development Kit), such as javax.sql.*, javax.naming.*, javax.crypto.*, javax.net.*, javax.security.auth.*, javax.swing.*, and javax.xml.parsers.*, should not be migrated.
What are the 'javax' and 'jakarta' namespaces?
They are different names for sets of Java libraries. 'Jakarta' is the newer evolution, used in more recent versions of servers and frameworks.
Do I need to do anything before using this tool?
Yes, it's recommended to run your project's build command (like './mvnw verify' or './gradlew build') before and after the migration to ensure everything is working correctly.
Details
Original description by the author
Migrate Java code from javax.* to jakarta.* namespace. Use only when the user explicitly asks for a javax to jakarta namespace or framework migration (for example to Tomcat 10+/11 or Jakarta EE), or when java-upgrade or spring-boot-4-migration delegates it. Finding javax imports alone does not authorize a migration.
repo: github/awesome-copilot
Popularity
- GitHub stars
- 40k
- Ranking position
- #7263
- License
- MIT
- Updated
- 10/15/2026
Comments
- β¦
More skills from this repository
acquire-codebase-knowledge
40kHelps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
acreadiness-assess
40kEnables 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.
acreadiness-generate-instructions
40kHelps 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.
acreadiness-policy
40kEnables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
Similar skills
api-connector-builder
280kHas 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.
api-design
280kHelps 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.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.