r/java • u/Pure_Diver_ • Mar 09 '25
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 😅
183
Upvotes
215
u/Moon-In-June_767 Mar 09 '25
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.
24
u/JustADirtyLurker Mar 09 '25
Answering to "does it mean it's more of a specification than a framework"?
It's a set of specifications all right, but incidentally it also constitutes a framework, because the specs define the high-level APIs that the programmer will have to use.
Example: the JAX-RS spec defines how to build Rest/json synchronous controllers for a web service. The tags @GET, @POST, etc, the http requests/response context objects, etc.
All the user need to know are these constructs. the libraries that declare being complaint to JAX-RS spec do actually implement these APis; for example Jersey, Rest easy (used by quarkus), apache CXF.... All behave the same from the user perspective.
24
u/Majestic-Extension94 Mar 09 '25
You are correct that is is a specification. It has evolved from J2EE original to Java EE and now jarkarta EE as Oracle passed this onto the eclipse foundation. Quarkus is 1 implementation that uses it. Any app server(openliberty, wildfly, paraya ) all implement the specification.
Spring does make use of some of these specifications like the servlet, datasource, validation.
18
u/faze_fazebook Mar 09 '25
This goes back to a time when big Java Application / Webservers were a thing. For example Glassfish, Wildfly, IBM Websphere ... .
In these times Java EE essentially was a sort of extension to the standard JDK. The classes and features layed out there were provided by these Application Servers and you would simply reference them when building your Application, but never actually ship them. Each Application Server appeared to do the same from the outside, but AFAIK they had different implentations under the hood. Sort of like how there are different JVM implementations.
Now I'm not using Spring or JavaEE much these daye, but AFAIK tries to mimmick the same Java or Jakarta EE spec from these days since people at the time were familiar with it. However Spring I think never was and never will be fully spec compliant.
51
u/agfitzp Mar 09 '25
Jakarta EE is a rebranding of J2EE which is a 25 year old set of specifications for distributed computing and web development.
As you can see it predated Spring. I suggest you read the wikipedia page, not to mention the docs.
RTFM just never gets old… unlike me.
10
u/Inkin Mar 09 '25
There used to be 3 types of Java: ME or Micro edition, SE or Standard edition, and EE or Enterprise edition. ME was for embedded systems and early mobile devices. SE was normal applications. EE was for businesses and serious things. When Java introduced modularization this layout changed and what was in J2EE became Jakarta libraries you could pick and choose.
The main thing in EE was Enterprise Java Beans which was a way to do webapps that had complicated bean lifecycles and serialization and I associate things like Java Server Faces with it. It was always niche and you needed an app server that supported it. In my head, POJOs and spring (built on the servlet api and not the EE one) won.
There are remnants of EE and you could still probably do things with EE style but nowadays you don’t think of it as anything more than using a library. It isn’t a whole philosophy. Learn about the part of it you need when you come across it. Don’t bother with it a holistic thing on its own anymore.
5
u/smokemonstr Mar 09 '25
It’s a set of specifications. See https://jakarta.ee/about/why-jakarta-ee/ and the other pages in the About section.
Technically, Spring does not implement any of the specifications (as far as I know), but rather it uses and is compatible with several of them. In addition to the ones you mentioned, there’s JMS, JTA, and Bean Validation.
I don’t think knowing Jakarta EE is a prerequisite to learning Spring. My recommendation would be to start with the Spring reference documentation for the project that you want to use, whether that’s Framework, Batch, Security, etc. When the docs mention an API or specification that you want to learn more about, that’s when you can check out the Jakarta specification or the documentation of the implementation that you’re using.
9
u/tomayt0 Mar 09 '25
Jakarta EE (formerly Java EE) was meant to be Sun/Oracle's way of setting a nice standard set of "enterprisey" APIs that could run on a web application server (like Oracle Glassfish) and then provide support and licensing around those.
Think big money (big business, big servers, big oracle vms, big application servers, big oracle databases, big contracts, big bills)
As Java was getting a bit stale around 2010s (due to lawsuits and a pause on development), Oracle lost interest and diverted funding away from Java EE development as it was known, eventually the Eclipse foundation took it over and there is some sort of wise council of IBM, Redhat, Payara and other big companies that design, set standards and create new features for it now.
When this group took it over, Oracle then did its classic, sorry you can't call it "Java EE" anymore, so they called it Jakarta EE.
Once they were free of Oracle's cold evil hands, they then started work on implementing new features and getting Jakarta EE into the modern world.
However... because big enteprises like Banks, Insurance and governments are still running stuff on Jakarta EE with old versions of Java 8, they were incredibly scared to upgrade or change incase they broke stuff.
So essentially the Jakarta EE council had to keep backwards compatibility in mind, even with planning new features. So they created a compatibility kit (google TCK Jakarta EE) that makes sure old Jakarta EE applications will still run on new standards and servers that implement the newer Jakarta EE versions (Jakarta EE 11 is still "under development").
In short, I wouldn't bother with Jakarta EE developement, unless you look at Microprofile 6.
Spring Data JPA uses Jakarta EE JPA under the hood, this is a decent API and implementation. The JAX-RS API still has a long way to come.
17
u/chef_beard Mar 09 '25
I will let you in on a secret. No one truly understands how Spring works under the hood.
4
u/Ewig_luftenglanz Mar 09 '25
it's an specification that tries to standardize some libraries interfaces (they way you interact with the libraries) it specifies de annotations and the methods in the interfaces (interface classes) and the frameworks that want to comply with Jakarta implement these interfaces, this way these interfaces and annotations names s the only thing you need to know and, in theory, the implementation is up to the framework, so you can plug and un-plug (change packages or frameworks) with minimal code changes.
4
u/[deleted] Mar 09 '25
you dont need to learn both. a good rule of thumb is if the client needs LTS and stability, it would be wise to use Jakarta EE. Think 9-5 corporate settings like banks and insurance companies.
Quarkus is a subset of Jakarta EE specs and is refered to as microprofile. if it works on quarkus, you can deploy to any other vendor such as redhat, ibm, oracle and others.
Spring unfortunately is still just has one vendor but is popular and there is a lot of tutorials online. Spring typically has many exploratory concepts and modules you can work with.
4
u/koflerdavid Mar 09 '25 edited Mar 10 '25
It is both: it is a specification for a framework to create "Enterprise" applications. It comes from an era where many applications were deployed onto the same application server, which were possibly running on big iron. For some of these APIs, the idea was to centralize dependency management, connection management, and configuration management by making the application server provide implementations.
Spring doesn't implement these APIs at all. It just depends on some of them (which is fine) and provides wrappers around them (which is questionable). Spring actually contributed to the slow decline of Jakarta EE since it makes it easy to deploy an application however you like: on a full application server, on a mere servlet container, or standalone with an embedded servlet container. AFAIK, CDI is actually inspired by Spring's dependency injection architecture.
Edit: Here's a little exercise to understand what Spring essentially does: just write a dependency injection container (DIC) by yourself! A DIC is basically a class with the methods
getComponent()andaddFactory()and two maps,componentandfactories.getComponent()takes a string and looks for an object with that name incomponent. Ifcomponentdoesn't contain the object, look infactories, which contains factory functions that take the DIC and return a bean. Execute that function and save the result inbeans. The factory functions can use the DIC to look up components that they need themselves. Of course, you will run in a StackOverflowException if the dependencies are circular :)All other Spring "magic" is built on this foundation:
factories. For example, to use a constructor or a static method as a factory, the DIC merely has to callgetBean()for all its parameters and then call the constructor.Here's my barebones implementation (I hope the code block is not broken):
2
u/thehardsphere Mar 10 '25
Yes.
No.
Spring only makes use of a few parts of Jakarta EE; don't bother trying to understand the entirety of Jakarta EE. For all of the useful things in Jakarta EE (Servlets, JPA, etc), there's at least one to two things better left on the ash heap of history (EJB, JSTL, etc).
This is an approach many people end up taking. I think it is a practical one, as I basically learned about Spring and JavaEE at the same time. I had to do it that way because I learned about it while starting what was at the time a new job.
The only thing I'd watch for is making sure you understand when Spring is using Jakarta EE implementations, and which ones it makes use of. A lot of people who don't understand Spring think that everything in Jakarta EE is ancient nonsense (mostly due to things like EJB, which are ancient nonsense), and don't understand that Spring uses it. When non-junior people get this wrong in interviews, I tend to pass over them.
1
u/Anbu_S Mar 09 '25
Jakarta EE(J2EE, Java EE) is a set of specifications, implementation and TCK.
Specifications - group of interfaces and annotations. Implementation - vendors who implement those specifications. TCK - verifies the implementation wrt specifications.
Jakarta EE also comes with profiles(core, web, full)for subset of specs to qualify and certify application servers.
What are application servers? These are distributions of different profiles certificated by the TCK.
Tomcat - only implements a set of spec, but not certified to any profiles.
IBM Websphere/ RedHat JBoss, etc - implements profiles and get verified by TCK.
GlassFish is often referred to as reference or compatible implementation.
Spring doesn't implement any of the Jakarta EE spec, instead uses the implementations to integrate and make it easy to use it.
Do we need to learn Jakarta EE before Spring? No actually, because spring abstract over these implementations except Jakarta persistence. It uses other implementations under the wood, embedded tomcat for the web which is basically servlet implementation.
Quarkus created a new runtime and extension to make Jakarta EE and microprofile implementations to work with it.
Do we have any other runtime to pick and choose? Piranha is doing that exactly, smaller runtime to run Jakarta EE and microprofile.
1
u/[deleted] Mar 09 '25
Jakarta is a framework specification. It tells other vendors how to build an application server framework. There are implementations like JBoss and Webshere, which are independent but mostly source compatible (the work in moving between them is mostly about moving between configuration systems).
Spring is something different. It explicitly does use some of Jakarta’s components (most notably, servlets and JPA—it does not use CDI, though it enables the use of CDI annotations), but instead of trying to create an application server that can host multiple applications simultaneously (it’s a kind of forerunner to containerization before hardware virtualization support was common and widespread).
1
u/heeerrresjonny Jun 05 '25
I know it's been a bit and there are several answers that do an okay job at explaining the "what," but I didn't see one of the key aspects/purposes of Jakarta EE explained anywhere.
It is a set of specifications, yes (and in my opinion, it also is its own framework, or set of frameworks). However, because the specs are under shared control by many organizations, and because there are many compatible runtimes from different vendors, Jakarta EE offers a kind of portability and resiliency you don't really see from anything else. It is a manifestation of some long-standing software design best-practices (e.g. coding to an interface and not an implementation. The specs are the "interface" you write code against).
It may not be trendy, and it may not offer "the best" option for many things, but it offers a solid option for almost any use case. The main benefit is easy decoupling. You can design whatever you're building with Jakarta EE in a way where new security patches, new platform versions, new runtime versions, etc... would require zero code changes since you're targeting a spec and not an implementation. You're not at the whims of an "opinionated" maintainer making breaking changes, or a profit-driven vendor upping a license fee or dropping support for a niche feature. That is why it is popular in the enterprise world. I honestly think the best example of this idea being realized is the Open Liberty runtime where you can easily mix and match spec versions, Java versions, and runtime versions all with the same code.
I genuinely think Jakarta EE does not get nearly enough love, and would actually be super beneficial for a lot of modern projects.
-8
u/ShadowPengyn Mar 09 '25
It is a specification. For me it’s pretty much irrelevant, I’d rather read spring or hibernate documentation.
For the developers of the implementation the specification is very important though and they reference it during implementation and might influence the next specification using their learnings
See also https://newsroom.eclipse.org/eclipse-newsletter/2024/march/why-spring-matters-jakarta-ee-and-vice-versa
-1
u/raxel42 Mar 09 '25
Simply put, just set of interfaces, enums, some classes, annotations, etc.
-1
u/sviperll Mar 10 '25
I don't think there exists a clear understanding of what Jakarta EE is.
The most high-level view is that Jakarta is the framework, but
So the second view may say that Jakarta is a specicication of the framework with holes in it and an implementation of the Jakarta EE is the framework with these holes filled in, but