Catalog
github/javax-to-jakarta-migration

github

javax-to-jakarta-migration

Migrate Java code from javax.* to jakarta.* namespace. Use when upgrading to Tomcat 11, Jakarta EE 10, or when javax imports are detected in the codebase.

v1.0Latest
New~599Updated Jun 26, 2026

javax → jakarta Migration Skill

When to Use

  • Upgrading to Tomcat 11 / Jakarta EE 10+
  • Code review detects javax.* imports
  • Migrating an existing project to the jakarta namespace

Procedure

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 JDK
  • javax.naming.* — part of JDK (JNDI)
  • javax.crypto.* — part of JDK
  • javax.net.* — part of JDK
  • javax.security.auth.* — part of JDK
  • javax.swing.*, javax.xml.parsers.* — JDK packages

Step 2 — Update pom.xml

Replace dependency coordinates:

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)

<!-- 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 all javax. imports with jakarta. equivalents in .java files.

Step 5 — Verify

  1. Run mvn clean compile or gradlew build — fix any compilation errors
  2. Run mvn test or gradlew test — ensure all tests pass
  3. Search for any remaining javax.* imports (excluding JDK packages)

Output

Provide a migration summary listing all files changed, imports replaced, and any manual steps required.

Files1
1 files · 1.0 KB

Select a file to preview

Overall Score

84/100

Grade

B

Good

Safety

88

Quality

85

Clarity

89

Completeness

75

Summary

This skill guides Java developers through migrating legacy javax.* package imports to the jakarta.* namespace, which is required for Jakarta EE 10+ and Tomcat 11. It provides a five-step procedure covering import scanning, dependency updates, XML configuration migration, source code replacement, and verification through compilation and testing.

Detected Capabilities

file read and searchdependency management (Maven/Gradle)source code refactoringXML configuration updatesbuild command executiontest execution

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

javax to jakarta migrationtomcat 11 upgradejakarta ee 10 migrationmodernize java eenamespace refactoringdependency upgrade guide

Referenced Domains

External domains referenced in skill content, detected by static analysis.

jakarta.eexmlns.jcp.org

Use Cases

  • Upgrade a Java project from Tomcat 9 to Tomcat 11
  • Migrate legacy Java EE codebase to Jakarta EE 10+
  • Update dependencies after detecting javax.* imports in code review
  • Modernize Spring Boot applications to latest Jakarta-compatible versions
  • Bulk-replace deprecated javax package references across a team project

Quality Notes

  • Clear, well-structured 5-step procedure that is easy to follow sequentially
  • Excellent distinction between packages that should migrate (jakarta.*) and those that remain in javax (JDK core packages)
  • Practical dependency mapping table simplifies the pom.xml update process
  • Includes verification steps with build and test commands to catch migration errors
  • XML namespace update example is specific and shows both old and new formats
  • Output expectations clearly defined (migration summary with files changed)
  • Strong guardrail: explicitly instructs agent NOT to migrate JDK packages, preventing over-broad replacements
Model: claude-haiku-4-5-20251001Analyzed: Jun 26, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use github/javax-to-jakarta-migration in your dev environment

Command Palette

Search for a command to run...

github/javax-to-jakarta-migration | SkillRepo