Java EE was donated to the Eclipse Foundation which had to rename it to Jakarta EE.
In the process, they had to change the dependency coordinates of the specifications and change the root package name.
It is not possible to mix Java EE and Jakarta EE (though there are tools for converting between them).
Now, if an application uses old Java EE dependencies on a Jakarta EE application server (or vice-versa), there will be compatibility issues as the server expects the application to use jakarta.*
types while the application references javax.*
types.
There are multiple questions (like this) where the OP is confused about problems arising from it.
I propose to add a canonical explaining the following:
- What is the difference between Java EE and Jakarta EE?
- explain that Java EE has been changed to Jakarta EE which includes renaming the
javax
package and changing the artifact coordinates
- explain that Java EE has been changed to Jakarta EE which includes renaming the
- What does one need to take care about in order to avoid compatibility issues?
- You should either only have Java EE dependencies or Jakarta EE dependencies
- include a link or list of changed dependencies
- Other (non-Java/Jakarta EE) dependencies need to be compatible with what is used, e.g. Hibernate 5 is for Java EE while Hibernate 6 is for Jakarta EE, similar for Spring Boot 2 vs Spring Boot 3
- The version of the application server/servlet container must support what you are using (e.g. Tomcat <=9 uses Java EE while Tomcat >=10 uses Jakarta EE).
- the root package name for Java EE imports needs to be
javax
and the root package name for Jakarta EE imports needs to bejakarta
. This cannot be mixed.
- the root package name for Java EE imports needs to be
- You should either only have Java EE dependencies or Jakarta EE dependencies
Any comments, agreements or disagreements?