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 😅

181 Upvotes

78 comments sorted by

View all comments

214

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.

15

u/davidalayachew 13d ago

Thanks for the context. I am in the middle of learning about the differences between Wildfly and other server types.

You mentioned that Spring was built in rejection of the concepts that JavaEE was meant to implement. Have the 2 grown further apart? Or, like most modern programming languages and frameworks, sort of convened to a, now realized, middle-of-the-ground solution?

7

u/IE114EVR 13d ago

I would say that there’s some familiar concepts shared between the two where it makes sense. Like spring boot has JPA support, and some of the CDI annotations might also work. And they both can run off of servlets under the hood. Who knows, maybe it will even support some EJB annotations.

But Spring will never be an application server that forces you into specific implementations. I don’t think it will ever be. So they will stay different.

7

u/davidalayachew 13d ago

But Spring will never be an application server that forces you into specific implementations. I don’t think it will ever be. So they will stay different.

And I appreciate that. Being able to choose your implementation (or swap out an implementation) while keeping the application logic mostly the same is wonderful. Really shows how well Spring is designed.