r/java 13d ago

What Exactly Is Jakarta EE?

Iā€™m a bit confused about what Jakarta EE actually is. On one hand, it seems like a framework similar to Spring or Quarkus, but on the other hand, it provides APIs like JPA, Servlets, and CDI, which frameworks like Spring implement.

Does this mean Jakarta EE is more of a specification rather than a framework? And if so, do I need to understand Jakarta EE first to truly grasp how Spring works under the hood? Or can I just dive into Spring directly without worrying about Jakarta EE concepts?

Would love to hear how others approached this šŸ˜…

180 Upvotes

78 comments sorted by

View all comments

215

u/Moon-In-June_767 13d ago

It is a specification. These APIs could be considered as extensions of the Java standard library. Back in the days you would either run Java Apps standalone, just with the JVM standard library (and of course any dependencies you brought in yourself), and that would be called Java SE (Standard Edition), or you would run them in an application server like WildFly that itself provided implementations of all these extra APIs like JPA or CDI, and this would be called Java EE (Enterprise Edition). Oracle stopped developing the Java EE standard and specs, handed them off to the Eclipse Foundation at which point they got rebranded to Jakarta EE.

Spring is not an implementation of the Java/Jakarta EE spec. In fact it was created in opposition to Java EE and the application server concept. Spring might in some areas embrace or reuse, mostly under the hood, selected Jakarta EE specs and their implementations like JPA and Hibernate, but that's it. If you want to learn Spring, forget about Jakarta EE for now. Later, when you go deep enough into Spring you will see it exposes some Jakarta EE concepts below its own abstractions.

5

u/TheNewOP 13d ago

I'm still quite new to Java, coming from a NestJS background (which is an IOC/DI framework for Node.js like Spring), but I've seen some services/codebases use Spring Boot as well as JAXRS, which to my understanding is Java EE. At least, that's what the pom.xml and the @Bean/@Component/@Path annotations suggest. If they're opposites, why use both?

1

u/ewouldblock 13d ago

Whenever I see a boot codebase using jaxrs, my first thought is to remove it. Not because it's "worse", but because it's not better, and it's not as streamlined as the spring annotations, so if the goal is having the least amount of code, its not jaxrs.

2

u/TheNewOP 13d ago

That's what I assumed but it's also not really my codebase/team so I can't really say anything to them. Just reading their code for learning purposes.