Java EE in 2021 – Jakarta EE [UPDATE]

Back in the days Java Enterprise Edition (EE) with all the Servlets, JSP and JSF, was the recomended way to build enterprise Java Web Apllications, today it’s just called Jakarta EE and under the Eclipse Foundation. Yes, the guys who made the worst IDE ever, JetBrains fans will agree.

For some reason everything that was called Java is now Jakarta, e.g. Jakarta Server Pages. It goes so far that with the Jakarta 9.0 realese the package name (namespace) has changed from javax.* to jakarta.*.

Setting up the environment

Make sure to add the downloaded server in Eclipse.

Hello Mars Example

  1. Create a New Maven Project with File → New…
  2. Add this dependency to pom.xml.
<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
  <name>Java EE 9 Maven Test</name>

The jakarta.jakartaee-web-api dependency should contain all the necessary classes, if this is not the case it can be changed to jakartaee-api for the full profile.

3. Create a Servlet class.

package ba.dragan.dx;


import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class TestServlet extends HttpServlet {

	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.getOutputStream().println("Hello Mars");

4. Run on the Server.

Right click on the project → Run As → Run on Server and select the previously added server.

Yes it’s that easy, for more info visit the Jakarta EE Documentation.

Leave a Reply

Your email address will not be published. Required fields are marked *