Jakarta profiles and runtime
What you will learn
Jakarta EE is a family of enterprise Java contracts, not a single application server. Choose a profile by required capabilities, then choose a compatible runtime.
- Distinguish specification, profile and runtime.
- Select the smallest appropriate EE 11 profile.
- Explain which javax packages must remain unchanged.
Plain Java examples: save as Main.java in a fresh directory, then run javac --release 21 Main.java and java Main. Jakarta EE examples require the pinned companion Maven project or separately configured illustrative infrastructure. Their predicted results are not execution evidence.
Choose profile by capability
public class Main { static String profile(boolean persistence,boolean messaging){return messaging?"Platform":persistence?"Web":"Core";} public static void main(String[] args) {System.out.println(profile(false,false));System.out.println(profile(true,false));System.out.println(profile(true,true)); }}Expected output:
CoreWebPlatformSimplified minimum-profile decision for these capabilities only.
Profile selection
Core Profile provides a small baseline for services: CDI Lite, Jakarta REST, JSON-B and JSON-P among its required contracts. Web Profile adds facilities for web applications, including Servlet, CDI Full, Persistence, Validation, Transactions and WebSocket. Full Platform adds Messaging and other enterprise facilities; verify exact inventory and certification for a particular version, profile and JDK. Optional or vendor-added features are not a portability guarantee. The API artifact is for compilation; a compatible implementation supplies behavior. Open Liberty 26.0.0.5 Web Profile on Java 21 is a documented candidate, not a tested installation.
Migration and inventory
Java EE 8 used javax names for affected enterprise APIs; Jakarta EE 9 moved those APIs to jakarta. Java SE packages such as javax.sql, javax.crypto and javax.naming remain unchanged. Review imports, XML namespaces, third-party dependencies, reflection strings, deployment descriptors and compatibility tests rather than performing global substitution. EE 11 inventory: Servlet 6.1, REST 4.0, CDI 4.1, Persistence 3.2, Validation 3.1, Transactions 2.0, JSON-B 3.0, JSON-P 2.1, WebSocket 2.2, Messaging 3.1, Concurrency 3.1, Security 4.0, Faces 4.1, Pages 4.0, Expression Language 6.0, Enterprise Beans 4.0 and Data 1.0. Faces builds component UIs; Pages renders views; EL evaluates expressions; Enterprise Beans provide container services; Data offers repository abstractions. These are conceptual survey topics, not executed demonstrations.
Keep Java SE namespaces
public class Main {
public static void main(String[] args) {for(Class<?> type:java.util.List.of(javax.sql.DataSource.class,javax.crypto.Cipher.class,javax.naming.Context.class)) System.out.println(type.getName()); }}Expected output:
javax.sql.DataSourcejavax.crypto.Cipherjavax.naming.ContextClass literals demonstrate that these three APIs compile and resolve on Java SE; not a migration tool.
Application root
Source-reviewed, NOT RUN. File lab-fixtures/jakarta-ee-v42/src/main/java/example/catalog/CatalogApplication.java; use the companion lab README.
package example.catalog;import jakarta.ws.rs.ApplicationPath;import jakarta.ws.rs.core.Application;@ApplicationPath("/api")public class CatalogApplication extends Application {}Predicted behavior: REST endpoints are rooted under /api.
The server context root is separate from @ApplicationPath.
Servlet endpoint
Source-reviewed, NOT RUN. File lab-fixtures/jakarta-ee-v42/src/main/java/example/catalog/PingServlet.java; use the companion lab README.
package example.catalog;import jakarta.servlet.annotation.WebServlet;import jakarta.servlet.http.*;import java.io.IOException;@WebServlet("/ping")public class PingServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException { res.setContentType("text/plain;charset=UTF-8"); res.getWriter().println("ready"); }}Predicted behavior: GET /catalog/ping writes ready.
Container owns servlet lifecycle; avoid storing per-request state in instance fields.
Common mistakes
Do not infer Platform compatibility from a Core certification, package API jars inside a WAR, or globally rename javax imports.
Practice
Print the profile required for a JSON REST service, a JPA service, and a JMS service: Core, Web, Platform. Implement the selection as a function.
Expected output:
CoreWebPlatformCompare with the manual review criteria.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Jakarta profiles and runtime — knowledge check
Jakarta EE enterprise Java reasoning.
What supplies runtime behavior?
Which profile is sufficient for the simplified REST and JSON service?
Which capability requires the Platform rather than the required Web Profile set?
Which namespace stays unchanged in Java SE?
What is server.xml in this lab?