Jakarta EE 11 Overview

Enterprise Java Platform for Building Scalable Applications

← Back to Index

What is Jakarta EE?

Think of Jakarta EE like a professional construction toolkit:

Jakarta EE (formerly Java EE) is a set of specifications that extend Java SE with enterprise features for building large, multi-tier, scalable, reliable, and secure applications.

History: Oracle donated Java EE to the Eclipse Foundation in 2017, and it was renamed to Jakarta EE. Jakarta EE 11 is the latest major release (2024).

Real-World Analogy: Building vs Blueprint

Why specifications matter: You write code once against the Jakarta EE specifications, and it runs on any compliant server (Payara, WildFly, Liberty, etc.) without changes!

Jakarta EE vs Java SE

Feature Java SE (Standard Edition) Jakarta EE (Enterprise Edition)
Purpose General-purpose programming Enterprise/business applications
Includes Core Java (collections, I/O, threads) Java SE + Web, persistence, security APIs
Application Type Desktop apps, simple servers Web apps, REST APIs, microservices
APIs java.*, javax.* jakarta.* (web, persistence, inject, etc.)
Server Required No (runs on JVM) Yes (needs application server)
Example Use Calculator app, file processor Banking system, e-commerce site

What's New in Jakarta EE 11?

Major Highlights

Evolution Timeline

Java EE 8 (2017) → Oracle hands over to Eclipse Foundation
   ↓
Jakarta EE 8 (2019) → Same as Java EE 8, new governance
   ↓
Jakarta EE 9 (2020) → Namespace change: javax.* → jakarta.*
   ↓
Jakarta EE 10 (2022) → Java 11+, CDI Lite, modern features
   ↓
Jakarta EE 11 (2024) → Java 21+, Virtual Threads, performance

Important Change: Jakarta EE 9+ uses jakarta.* packages instead of javax.*

// Old (Java EE / Jakarta EE 8)
import javax.servlet.*;
import javax.persistence.*;

// New (Jakarta EE 9+)
import jakarta.servlet.*;
import jakarta.persistence.*;

Core Jakarta EE Specifications

1. Web Tier

2. RESTful Web Services

3. Enterprise Beans

4. Persistence

5. Dependency Injection & Context

6. Security

7. Messaging

Jakarta EE Architecture

Multi-Tier Architecture

┌─────────────────────────────────────────┐
│         Client Tier (Browser)           │
│  HTML, CSS, JavaScript, React, Angular  │
└─────────────────┬───────────────────────┘
                  │ HTTP/REST
┌─────────────────▼───────────────────────┐
│           Web Tier (Server)             │
│  Servlets, JSP, JSF, JAX-RS, WebSocket │
└─────────────────┬───────────────────────┘
                  │
┌─────────────────▼───────────────────────┐
│         Business Tier (Server)          │
│     EJB, CDI Beans, Business Logic      │
└─────────────────┬───────────────────────┘
                  │
┌─────────────────▼───────────────────────┐
│    Persistence Tier (Database)          │
│     JPA, JDBC, Database Access          │
└─────────────────────────────────────────┘

Container Services

Jakarta EE servers provide "container services" - features you don't have to implement yourself:

Simple Jakarta EE Example

Let's build a simple REST API with Jakarta EE:

1. REST Endpoint (JAX-RS)

package com.example;

import jakarta.ws.rs.*;
import jakarta.ws.rs.core.*;
import java.util.*;

@Path("/hello")  // URL: /api/hello
public class HelloResource {

    @GET  // Handle GET requests
    @Produces(MediaType.TEXT_PLAIN)
    public String sayHello() {
        return "Hello from Jakarta EE 11!";
    }

    @GET
    @Path("/{name}")  // URL: /api/hello/John
    @Produces(MediaType.TEXT_PLAIN)
    public String sayHelloToName(@PathParam("name") String name) {
        return "Hello, " + name + "!";
    }

    @GET
    @Path("/json")
    @Produces(MediaType.APPLICATION_JSON)
    public Map<String, Object> getJson() {
        return Map.of(
            "message", "Hello Jakarta EE!",
            "version", 11,
            "timestamp", System.currentTimeMillis()
        );
    }
}

2. Application Configuration

package com.example;

import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;

@ApplicationPath("/api")  // Base URL for all REST endpoints
public class RestApplication extends Application {
    // No code needed! Just this annotation
}

3. Deploy and Test

# Package as WAR file
mvn clean package

# Deploy to Jakarta EE server (Payara, WildFly, etc.)
# Server automatically detects and configures the application

# Test the endpoints
curl http://localhost:8080/myapp/api/hello
# Output: Hello from Jakarta EE 11!

curl http://localhost:8080/myapp/api/hello/Alice
# Output: Hello, Alice!

curl http://localhost:8080/myapp/api/hello/json
# Output: {"message":"Hello Jakarta EE!","version":11,"timestamp":1704067200000}

What just happened?

Jakarta EE Profiles

Jakarta EE Platform (Full Profile)

Jakarta EE Web Profile

Jakarta EE Core Profile (New in 10)

Profile Size Use Case Example Server
Full Platform Large (~200MB+) Enterprise monoliths WildFly, Payara
Web Profile Medium (~100MB) Web apps, REST APIs TomEE, Payara Micro
Core Profile Small (~30MB) Microservices, cloud Helidon, Open Liberty

Popular Jakarta EE Servers

1. Eclipse GlassFish

2. Payara Server

3. WildFly (Red Hat JBoss)

4. Open Liberty (IBM)

5. Apache TomEE

Getting Started with Jakarta EE 11

Prerequisites

# 1. Java SE 21 or later
java -version  # Should show 21+

# 2. Maven or Gradle
mvn -version

# 3. Jakarta EE Server (choose one)
# Download: GlassFish, Payara, WildFly, etc.

Maven Project Setup

<project xmlns="http://maven.apache.org/POM/4.0.0">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>jakarta-ee-app</artifactId>
    <version>1.0</version>
    <packaging>war</packaging>

    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <jakarta.ee.version>11.0.0</jakarta.ee.version>
    </properties>

    <dependencies>
        <!-- Jakarta EE 11 API (provided by server) -->
        <dependency>
            <groupId>jakarta.platform</groupId>
            <artifactId>jakarta.jakartaee-api</artifactId>
            <version>${jakarta.ee.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>

Directory Structure

jakarta-ee-app/
├── pom.xml
└── src/
    └── main/
        ├── java/
        │   └── com/example/
        │       ├── HelloResource.java
        │       └── RestApplication.java
        └── webapp/
            ├── WEB-INF/
            │   └── web.xml (optional in Jakarta EE)
            └── index.html

Jakarta EE vs Spring Framework

Aspect Jakarta EE Spring Framework
Type Specification (standards) Framework (implementation)
Governance Eclipse Foundation (open) VMware (company)
Server Required Yes (Jakarta EE server) No (embedded Tomcat)
Dependency Injection CDI (@Inject) Spring IoC (@Autowired)
REST API JAX-RS (@Path) Spring MVC (@RestController)
Persistence JPA (standard) Spring Data JPA (wrapper)
Learning Curve Moderate (standards-based) Easier (opinionated)
Adoption Enterprise, government Startups, modern apps
Portability High (any EE server) Medium (Spring-specific)

Which to choose?

Best Practices

✅ DO:

  • Use CDI everywhere - It's the backbone of Jakarta EE
  • Leverage container services - Let the server manage lifecycle, transactions, security
  • Follow specifications - Write portable code that works on any server
  • Use annotations - Less XML, more declarative programming
  • Start with Web Profile - Most apps don't need Full Profile
  • Use JPA for database - Standard ORM solution
  • Build REST APIs with JAX-RS - Clean, annotation-based

❌ DON'T:

  • Don't manage threads manually - Use @Asynchronous or Managed Executors
  • Don't mix Jakarta EE and Spring randomly - Pick one approach
  • Don't use Full Profile unless needed - Web Profile is usually enough
  • Don't ignore CDI scopes - Understanding scopes is crucial
  • Don't write framework code - Use what Jakarta EE provides

Summary

  • Jakarta EE is a set of specifications for enterprise Java applications
  • Jakarta EE 11 requires Java 21+ and includes modern features like Virtual Threads
  • Namespace: Uses jakarta.* packages (not javax.*)
  • Three profiles: Full Platform, Web Profile, Core Profile
  • Core technologies: Servlets, JAX-RS, JPA, CDI, EJB, Bean Validation, Security
  • Container services: Dependency injection, transactions, security, lifecycle
  • Servers: GlassFish, Payara, WildFly, Open Liberty, TomEE
  • Benefits: Standards-based, portable, vendor-neutral, enterprise-ready
  • Use when: Building scalable enterprise apps with standardized approach