Background
Why did javax become jakarta?
Oracle transferred Java EE to the Eclipse Foundation but kept the rights to the javax name. The new platform, Jakarta EE, therefore had to use a new package prefix. Jakarta EE 9 renamed the packages and changed no features. Jakarta EE 10 and later add features on top of the new names.
The rename matters now because current runtimes depend on it: Spring Boot 3 (Spring Framework 6), Tomcat 10 and later, Jetty 11 and later, and current Hibernate and Jersey releases. You cannot mix the two sets in one classpath for the same API.
Scope
Which packages change, and which stay javax?
Only Java EE packages move. Packages that belong to the JDK or to Java SE keep javax. A blind find and replace breaks these.
| Moves to jakarta | Stays javax |
|---|---|
| javax.servlet, javax.servlet.http | javax.sql (JDBC) |
| javax.persistence (JPA) | javax.naming (JNDI) |
| javax.validation | javax.crypto, javax.net, javax.net.ssl |
| javax.ws.rs (JAX-RS) | javax.security.auth, javax.security.cert |
| javax.annotation (@PostConstruct and others) | javax.management (JMX) |
| javax.inject, javax.enterprise (CDI) | javax.xml.parsers, javax.xml.transform |
| javax.jms, javax.ejb, javax.transaction | javax.swing, javax.imageio |
| javax.xml.bind (JAXB), javax.xml.ws (JAX-WS) | None of the above |
Tooling
What does the OpenRewrite jakarta recipe do?
The OpenRewrite javax to jakarta recipe, usually org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta, rewrites imports and fully qualified names, updates XML descriptors such as web.xml and persistence.xml, and bumps known dependencies to their jakarta versions. Confirm the name against the current catalogue before use. See OpenRewrite for how recipes work and what they leave undone.
Other tools exist. The Eclipse Transformer rewrites compiled classes and jars, which helps when you cannot change source. Apache Tomcat provides a migration tool that converts web applications for Tomcat 10. We use a recipe on source, since the result is a diff an engineer can read.
The hard part
Which libraries lag, and how do you find them?
A dependency that still ships javax classes fails at runtime, often with a ClassNotFoundException or a NoSuchMethodError deep in a stack trace. For every dependency that touches servlets, persistence, validation, REST, JAXB, mail or JMS, check for a release built on jakarta.
F-01Hibernate: version 6 for jakarta. Version 5.6 offers a jakarta classifier as a bridge.F-02Jersey: version 3 and later. CXF: 3.5 and later for jakarta.F-03Jackson: the JAX-RS and JAXB providers have jakarta variants. Check each module you use.F-04Swagger and OpenAPI libraries: use jakarta builds, or move to springdoc for Spring.F-05Unmaintained libraries: some have no jakarta release at all. Replace them or fork.F-06Application-specific vendor libraries: ask the vendor, because this is the item that sets the schedule.
Hidden references
What else still says javax after the recipe?
These are the ones that pass compilation and fail in production. A search for the string javax outside imports, plus a full test run, finds most of them.
F-01String class names in XML or properties files, for example a filter class or a JPA provider name.F-02META-INF/services files and Spring factories that list javax implementations.F-03Reflection and Class.forName calls built from strings.F-04XML namespaces in descriptors, which must point to the jakarta schemas.F-05Generated sources, for instance JAXB or JAX-WS output checked into the repo.F-06Build plugins and annotation processors that generate javax code.
Sequence
What order should the migration run in?
For the framework side of the same change, see Spring Boot 3 migration. For the server side, see WebLogic to Tomcat.
Step 02 of 05
Dependency audit
List every library and its jakarta status before touching code.
Step 03 of 05
Run the recipe
Apply it, then read the diff and the compile errors.
Step 04 of 05
Fix stragglers
Upgrade, replace or shim each library. Check the hidden references above.
Step 05 of 05
Test
Run the suite against a jakarta runtime such as Tomcat 10.1 or a Jakarta EE 10 server.
Evidence
What does a recipe run find on a real application?
We are running the recipe on an open-source Java 8, Spring Boot 2 application. The run will report files changed, the unresolved-dependency list and test results before and after. It is not published, so we state no numbers. This is the first-party data the page will carry when it is ready.
- Files changed
- Pending
- Tests before and after
- Pending
- Manual fixes
- Pending
- Engineer review time
- Pending
Results publish here when the run completes. No figures until then.