INTRODUCTION
Starting from this tutorial, we will demystify most of the Jakarta EE documentation making easier for junior Java developers to understand it and use it efficiently.
As a first step, we need to setup our environment that will include an application server and a development code editor. This is the first part of the setup process.
CHOOSING AN APPLICATION SERVER
Before we choose and install an application server, let's first understand why we need one. If we go to the Jakarta EE homepage (https://jakarta.ee/specifications/), we will notice that in reality Jakarta EE is a set of specifications that define how to build and run enterprise applications in Java. It provides a set of APIs for building robust, scalable, and secure enteprise applications, covering areas like Web development, Messaging, Transactions, and Persistence.
To run Jakarta EE applications, you typically need an application server because it provides the necessary infrastructure to support and execute the Jakarta EE specifications.
Most specifically, an application server is needed for Jakarta EE because it provides the following services:
- Implementation of Jakarta EE Specifications: Jakarta EE provides the blueprint for enterprise applications, but an application server implements those specifications. For example, Jakarta EE defines how to handle Servlets (with the Servlet API) and how to manage dependency injection (via CDI), but an application server like Payara or Wildfly actually implements these APIs and makes them available for your application to use.
- Dependency Injection and Context Management: Jakarta EE relies heavily on dependency injection (DI) to manage objects and their lifecycle, ensuring that dependencies are automatically injected when needed. The application server manages this DI container, ensuring that objects are created, injected, and destroyed correctly based on the context in which they are used (such as a session or request scope).
- Transaction Management: Jakarta EE provides support for distributed transactions and transaction management. The application server ensures that these transactions are properly coordinated across various resources, such as databases or message queues, while maintaining consistency and rollback capabilities in case of failure.
- Security and Authentication: Jakarta EE applications often require complex security measures, such as authentication and authorization. The application server typically provides these services out of the box, integrating with various security frameworks and protocols (like LDAP, OAuth, etc.).
- Scalability and Clustering: Jakarta EE applications are often built to scale, and an application server typically provides the infrastructure for load balancing, clustering, and high availability. This ensures that enterprise applications can handle large numbers of users and can recover from server failures.
- Web and Enterprise Components: Jakarta EE includes APIs for working with Servlets, JSP, JMS (Java Message Service), and other enterprise-level features. An application server provides the runtime environment where these components can run, interact with each other, and ensure that everything is configured and optimized.
All our tutorials will be based on Wildfly server which is considered one of the top choices for Jakarta EE applications. In addition to the fact that is free and has a very active community, it is also known for being lightweight, fast, and highly flexible, while still offering full support for the Jakarta EE specifications.
The default option is to create a Management User. That is exactly what we would like to create so at this step we just accept this choice by pressing Enter.
Provide a password for the admin account. If you are just practicing with personal projects, the password does not have to be very complicated. In my case, I typed 7 characters, instead of the required 8, and I got a warning. This is perfectly fine. Just type yes to inform Wildfly that you are fine with the password you typed.
We do not desire to assign the new account to any additional groups, so we just press enter on this step.
On the Add Server Instance window, choose Wildfly Application Server. You can give it a friendly name if you wish. This is a useful feature in case you are running multiple Wildfly instances. Click Next to continue to the next step.
Find the folder where you previously unzip the Wildfly Server. NetBeans automatically will add the full profile which, in addition to database connection, adds also support for Message Broker connectivity. Click Next to continue.
On this final step, we need to add the username and password that we have setup on the wildfly for the admin account. Click Finish to complete the process.
Within NetBeans now we can easily manage the running state of Wildfly. To start the Wildfly server right click on the icon and choose start.
So far we have installed an application server, and a IDE environment. However, our applications will need to write and read data from a database. So our next step is to create a connection from the application server to a database. We will cover these steps on the next Jakarta EE for Junior Developers lesson.

0 Comments
What do you think about Ground of Code?