Getting Started with Java EE — Part I: Configuring Boss/WildFly

Henry Delgado, BCS, MBA
7 min readJan 5, 2020

--

The purpose of this tutorial is to configure a local Java EE environment that uses Maven, JBoss, and WildFly. At the end of this tutorial, you should be able to run a basic Java web page that we will create from scratch using Eclipse IDE. This tutorial is a startup guide for developers that are new to Java EE or Java developers that are exploring WildFly for the first time.

I am a software engineer that has been programming in different languages since 1998. Most of my recent projects are written in .NET languages. I have previously worked with Java but not at the enterprise level. One of my personal career goals this year is to have complex Java applications working with Docker containers and Kubernetes. I want to implement the same microservice principles that I learned while working with .NET and apply them to my Java projects.

Most of us start with a hello world when learning a new language but I was attempting to start with a simple Java dynamic web page (backend development). I attempted to follow different online tutorials for setting up my local Java EE environment. However, I could not replicate a local environment running without any errors after following those approaches. It could have been that those tutorials were for a more advanced audience. I decided to gather my efforts and share my findings for those who might face the same issues in the future. I want you to be able to successfully run a web page at the end of this tutorial. I have tested my guidelines using both a Mac and a PC.

Disclaimer

I understand that there might be many other options (better or worse) available for Java web development at the enterprise level but I need to work with the following stack for now:
1. Java 8
2. JBoss
3. Maven
4. Spring

We will not cover how to configure or how to work with each of the previous elements. That is out of scope for now but that is to simply explain my limitations.

Feel free to leave comments or suggestions for alternative tools or plugins when working with that stack.

Installations and Configurations

There are several people in my development team anticipating that new members might join us in the future. I might also alternate working between a Mac and a PC. Clearly, I need an easy way to reproduce these configurations to save time and other resources.

Are you thinking what I am thinking? Containers!

Yes, that would be so much easier not only for developers but also for QA engineers. Let’s keep containers in mind but let us finish this environment locally first. (That sounds like another blog for this year)

Java and Eclipse IDE

  1. Install JDK. I will be using Java 8.
  2. Install Eclipse for Java EE: Download Java EE option.

I have tried using Visual Studio Code and NetBeans. I like different things from each of those. I have chosen Eclipse for this tutorial because it was very easy to install all the things that I needed in one place and it works with no additional steps.

Please feel free to leave your comments if you have better experience with other IDEs but keep my requirements in mind.

Configure Eclipse to use JBoss/WildFly

  • Once the Eclipse Installer shows the following options, ensure to select the IDE for Enterprise Java Developers. The selected option contains tools for creating Enterprise Java and Web Applications such as Maven and others.
  • Open the Eclipse IDE and close the welcome page. Got the Help menu and select Eclipse Market Place.
  • Search for JBoss Tools and install it. That will allow us to work with JBoss and WildFly.
  • You can leave all the default options and accept the license agreement. You will see the following warning. Click Install Anyway to proceed. You will need to restart Eclipse after the installation.
  • Now you need to install and setup WildFly server. Once you restarted the Eclipse and closed the Welcome Page, you will see a page similar to the following. Go to the Servers Tab. Click on the link “Click this link to create a new server”
  • Define a new WildFly server. In my case, I have selected the latest version of WildFly. Then you can leave the hostname as default (localhost) and click next.
  • Leave everything as is for now on the Server Adapter section and click Next again
  • We have not downloaded or installed WildFly yet. On the following screen, click on the link to “Download and Install Runtime…”
  • Select the latest available option or whichever option you need on your custom implementation. I am using WildFly 18.0.1. Then click Next.
  • Accept the license agreement and click Next.
  • Ensure you select the proper installation path. Remember this path for the following steps.
  • The following screen is the same as the screen in step 9. However, this time the Home Directory contains the WildFly installation path from previous step 12.
Important Note: Ensure that your Runtime JRE matches the JDK version that you have previously installed. In my case, I selected the Alternate JRE because I have previously installed the JDK 1.8.0_231. Click Finish.
  • Now your Servers tab should display the WildFly at localhost as seen below.
  • You can continue to use Eclipse to start your WildFly server. Right click on the Server and click on Start. You should see now the Console tab with some activity indicating the status of your attempt to start the server. Notice that it provides you the links for your Admin Console and the Management site.
  • If we are testing this in a local environment, then we can simply go to that link (i.e. http://127.0.0.1:9990). However, you might need additional steps if you are using a docker container to host your Jboss/WildFly server. I will cover that in a different section where I will explain to work with Java EE and Docker containers. If you have been following this tutorial up to this point, you should see the following screen when you browse to http://127.0.0.1:9990.
  • We need to add a user before we use the WildFly server. The previous screen asks me to modify the add-user.bat. However, you can do that in several ways using different files if you are using Mac or Windows. I will implement this step from a Windows computer and will execute the add-user.bat.
  • After executing the add-user.bat, I will see the following screen where I will select the option a.
  • Enter your server user name:
  • Then enter and re-enter your password. Leave the rest of the options as default (say yes).
  • Go back to the browser (http://127.0.0.1:9990/) and refresh the screen. Now, you should see the following prompt asking you to login with that new user you just created. Click Sign in after you entered your username and password.
  • Now you should see the WildFly Home Console as in the following screen.

On Part I, we have completed our configurations. If you can see the previous screen in your browser (HAL Management Console), you have successfully installed and configured JDK, Eclipse, JBoss, and WildFly.

On Part II, we will create a basic Java web application that we will use to test our new server.

See you in Part II!

--

--

Henry Delgado, BCS, MBA

A passionate software developer eager to learn, evaluate and share!