Bootstrap your first Jakarta EE 8 application

Last Updated:  January 11, 2020 | Published: September 11, 2019

As Jakarta EE 8 was now finally released on the 10th of September 2019, we can start using it. This is the first release of Jakarta EE and a big accomplishment as everything is now hosted at the Eclipse Foundation. The Eclipse Foundation hosted an online conference (JakartaOne) during the release day with a lot of interesting talks about the future of Jakarta EE. Stay tuned, as the talks will be published on Youtube soon! For now, there will be no new features compared to Java EE 8, but the plan is to have new features in Jakarta EE 9. With this blog post, I'll show you how to bootstrap your first Jakarta EE 8 application using Java 11 with both Maven or Gradle.

Use Maven to bootstrap your Jakarta EE application

To start with your first Maven Jakarta EE 8 project, your pom.xml now needs the following jakartaee-api dependency:

During the online conference, Adam Bien also announced to create a new Maven archetype to bootstrap Jakarta EE 8 applications with a single command.

Use Gradle to bootstrap your Jakarta EE application

If you use Gradle to build your application, you can start with the following build.gradle:

Sample Jakarta EE 8 application

As there are no new features for Jakarta EE 8 yet, you can make use of everything you know from Java EE 8. For a sample project, I'll create a JAX-RS application which fetches data from an external service and exposes them:

For now, everything is still in the javax.* namespace as there are no modifications, but once the specifications evolve, they will move to jakarta.*.

Deploy your application

At the time of writing there are already three application servers officially Jakarta EE 8 Full Platform compatible: Glassfish 5.1, Open Liberty 19.0.0.6 and WildFly 17.0.1.Final. You can get an overview of all compatible products here.

For a quick example, I'll deploy the sample application to WildFly 17.0.1.Final running inside a Docker container:

To run the Jakarta EE 8 application on WildFly you don't have to configure anything in addition, it just works 😉

So if you are already familiar with Java EE 8, it's easy for you to adapt Jakarta EE 8. As we now have the Eclipse Foundation Specification Process  (EFCP), we should see new features and platform releases way more often.

For further information about Jakarta EE, have a look at the official website.

The code for this example is available on GitHub.

Have fun using Jakarta EE,

Phil

How can I create a Jakarta EE 8 application with Gradle?

Add the following dependency to your build.gradle as providedCompile jakarta.platform:jakarta.jakartaee-api:8.0.0

  • Hello, first, a congrats for article. Second, my big doubt, how the implementation knows that ‘UserProvider’ is an EJB? It is not annotated with @Stateless or equivalents…

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
    >