Scrivio Interview library
ConceptFoundations5 min read · updated 12 November 2026

Why did packages change from javax.* to jakarta.*, and which Spring versions require the jakarta namespace?

When Oracle handed Java EE to the Eclipse Foundation it became Jakarta EE, but Oracle kept the Java trademark, so new versions of the APIs could not keep using the javax namespace. Jakarta EE 9 therefore renamed the packages from javax.* to jakarta.* with no other API changes. Spring Framework 6 and Spring Boot 3 were the first versions to require the jakarta APIs, and Spring Framework 7 with Spring Boot 4 raises the baseline to Jakarta EE 11.

Why this question is asked

Anyone who has upgraded a Spring Boot 2 application to version 3 has seen hundreds of import lines change from javax.persistence to jakarta.persistence. It looks like a pointless rename, and in a sense it was: the code inside the APIs did not change at all. Interviewers ask about it because it explains a whole family of upgrade failures, from ClassNotFoundException at startup to libraries that silently stop working. In this answer, we will see why the rename happened, what exactly changed in Jakarta EE 9, which packages did not change, and which Spring versions need which namespace.

1A Quick Recap of Java EE

Java EE (Enterprise Edition) was a set of specifications for server-side Java: Servlets for HTTP, JPA for persistence, Bean Validation, JMS for messaging, JAX-RS for REST and more. Each specification was an API in a javax package, such as javax.servlet or javax.persistence, plus implementations from vendors: Tomcat implements Servlets, Hibernate implements JPA. Sun and later Oracle owned the specifications.

2Why the Namespace Had to Change

In 2017 Oracle moved Java EE to the Eclipse Foundation, an open-source foundation, so that the community could evolve it. The platform was renamed Jakarta EE. But Oracle kept the Java trademark, and the agreement allowed the Eclipse Foundation to use the existing javax packages only as they were, without modification. Any new or changed API had to live in a new namespace.

Jakarta EE 8, released in 2019, was the same as Java EE 8 and still used javax. The community then had a choice: rename packages gradually as each specification changed, or rename everything at once. They chose the big bang. Jakarta EE 9, released in 2020, renamed every package from javax.* to jakarta.* and made no other API changes, so that the ecosystem could migrate once and then evolve freely.

From Java EE to Jakarta EE
VersionYearNamespaceWhat changed
Java EE 82017javaxLast Oracle release
Jakarta EE 82019javaxSame APIs, new home at Eclipse
Jakarta EE 92020jakartaPackage rename only
Jakarta EE 102022jakartaFirst new features, e.g. Servlet 6, CDI 4
Jakarta EE 112025jakartaServlet 6.1, Persistence 3.2, Java 17+

3What Exactly Changed in Jakarta EE 9

The rename touched the packages of every Jakarta specification, and the Maven coordinates of the API jars changed with them. Classes kept the same names and methods, so the code change is mechanical.

Java
// Before (Spring Boot 2, Java EE / Jakarta EE 8)
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.NotNull;
// After (Spring Boot 3+, Jakarta EE 9+)
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.constraints.NotNull;
// Mixing them fails at runtime, for example:
// an @Entity from javax.persistence is not seen by Hibernate 6 -> "Not an entity"

But there is a catch: not every javax package belonged to Java EE. Packages that are part of the JDK itself, such as javax.sql, javax.crypto, javax.net.ssl, javax.naming and javax.transaction.xa, stay as they are. So a blind search and replace of javax with jakarta breaks code that uses javax.sql.DataSource. Annotations like @PostConstruct moved from javax.annotation to jakarta.annotation, because they came from the Java EE Common Annotations specification rather than the JDK.

4Which Spring Versions Need Which Namespace

Spring Framework 5 and Spring Boot 2 use javax. They work with Java EE 8 and Jakarta EE 8 implementations, such as Tomcat 9 and Hibernate 5.

Spring Framework 6 and Spring Boot 3, released in late 2022, require jakarta. Their baseline is Jakarta EE 9 with support for Jakarta EE 10, and they need Java 17 or later. That means Tomcat 10.1, Jetty 11 or 12, Hibernate 6 and Hibernate Validator 8, and every library that touches these APIs must have a jakarta version.

Spring Framework 7 and Spring Boot 4 keep jakarta and move the baseline to Jakarta EE 11: Servlet 6.1, Jakarta Persistence 3.2 and Bean Validation 3.1, with Hibernate ORM 7 and Tomcat 11 or Jetty 12.1. Check the exact versions in your Boot release notes.

Spring versions and the namespace
SpringBootNamespaceJakarta EE baseline
Framework 5.32.7javaxJava EE 8 / Jakarta EE 8
Framework 6.x3.xjakartaJakarta EE 9, supports 10
Framework 7.x4.xjakartaJakarta EE 11

5Follow-up questions

Can a single application use both javax and jakarta APIs?

Technically both API jars can be on the classpath, but the frameworks only look at one set. Hibernate 6 only recognises jakarta.persistence annotations, Tomcat 10 only loads jakarta.servlet classes. So a library still compiled against javax.servlet, for example an old filter, will not work in a Spring Boot 3 application, even though it compiles.

Why did they not keep javax and just add new packages?

Because the trademark agreement did not allow evolving the javax packages, and adding jakarta packages one specification at a time would have left applications with a confusing mix for years. A single rename in Jakarta EE 9 was painful but gave the ecosystem one clear migration point.

Is Jakarta EE 9 functionally different from Java EE 8?

Hardly. Jakarta EE 9 was deliberately a rename with a few removals of very old APIs. Real new features started with Jakarta EE 10, such as CDI Lite, Servlet 6 and the Core Profile.

6Conclusion

In this answer, we saw that the javax to jakarta change came from the move of Java EE to the Eclipse Foundation: Oracle kept the Java trademark, so the APIs could only evolve under a new namespace. Jakarta EE 9 renamed every package to jakarta.* without other API changes, while JDK packages such as javax.sql stayed. Spring Framework 6 and Spring Boot 3 require jakarta, and Spring Framework 7 and Spring Boot 4 raise the baseline to Jakarta EE 11.

What to say in the interviewAbout 80 seconds aloud

Open with

It was a legal and governance change rather than a technical one. Oracle moved Java EE to the Eclipse Foundation, where it became Jakarta EE, but Oracle kept the Java trademark, and the agreement said the javax packages could be used only as they were.

Then, if they want more

So to evolve the APIs at all, they needed a new namespace. Jakarta EE 8 was identical to Java EE 8 and still javax. Jakarta EE 9 then renamed all the packages to jakarta at once, javax.servlet to jakarta.servlet, javax.persistence to jakarta.persistence and so on, without changing the APIs, so the ecosystem could migrate once.

One thing to watch is that packages from the JDK itself, like javax.sql or javax.crypto, did not change, so a blind search and replace breaks things. On the Spring side, Spring Framework 5 and Boot 2 use javax. Spring Framework 6 and Boot 3 require jakarta, with a Jakarta EE 9 baseline, support for EE 10, and Java 17.

Spring Framework 7 and Boot 4 stay on jakarta and move the baseline to Jakarta EE 11, so Servlet 6.1 and Persistence 3.2. In practice it means every library touching those APIs needs a jakarta-compatible version before you upgrade.

About this answer

Last updated
12 November 2026
Versions it names
Jakarta EE 9, Spring Boot 3, Hibernate 6, Jakarta EE 11
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Jakarta EE specifications
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Why did packages change from javax.* to jakarta.*, and which Spring versions require the...": https://scrivio-interview-library.netlify.app/java/jakarta-ee-platform/55c4ff6805/