How to Deploy a Java Application with Wildfly Application Server – The New Stack

Wildfly is a modular, lightweight Java application server managed by Red Hat that can be deployed for free in your data center or on a third-party cloud host. We’ve covered deploying Wildfly on an Ubuntu Server 20.04 instance and now we’ll take it a step further and see how easy it is to deploy a Java application with the platform.

For this to work, you will need the following:

  • A running instance of Wildfly
  • A sample Java application to deploy

Before demonstrating the actual deployment, we need to create a deployable Java application. For this, we will turn to the Hello, World!

Install the Java JDK

To create the Java application, we’re going to need a little help from the Java JDK. Since we are demonstrating on Ubuntu, installing the Java JDK is quite simple. Log in to your Ubuntu machine, open a terminal window and run the command:

sudo apt-get install default-jdk -y

The installation will take care of all necessary dependencies. Once complete, you can verify the installation with:

java --version

You should see something like the following in the output:

Build a Java Application

Next, we’ll create a simple Java application. With Wildfly, you can deploy file types such as EJB-JAR, WAR, EAR, or any standard archive type (like RAR). We will create a WAR archive for our Java deployment.

To do this, create a new directory with the command:

mkdir HELLOWORLD

Navigate to this newly created directory with the command:

cd HELLOWORLD

In this directory, create two other directories with the commands:

Next, create the index.jsp file with the command:

nano index.jsp

In this file, paste the following content:




JSP testing

Channel Title = “Hello World”;
%>




If you see this, the sample war file was correctly from >






You are from