When developing Java EE/Jakarta EE projects, you know you will need a Java server. Some of the most used Java Enterprise servers include Apache Tomcat, Glassfish, Jetty and WildFly/JBoss server. Not all these server provides all needed features but all of them provide most of the enterprise features needed. Glassfish and WildFly/JBoss provides a complete set of features and is mostly used by enterprises.
For CentOS: Install WildFly (JBoss) Server on CentOS 8 / CentOS 7
In this article, I will show you how to install WildFly. But first, what is the difference between Wildfly and JBoss AS? Wildfly is the community edition for the Java EE server while JBoss As is the enterprise edition for the enterprise. Both are sponsored by Redhat Inc. So JBoss AS simply put is the secured version of WildFly.
Update your Ubuntu package APT index:
sudo apt update
So obviously the first thing to do is to have Java installed.
sudo apt install -y default-jdk
Confirm that Java installation was successful in your system
Install WildFly on Ubuntu 20.04|18.04
Install wget and curl utilities on your Ubuntu system
sudo apt install wget curl
We will download WildFly and choose the location to install. Our installation will be on ~/eclipse/servers/
directory:
mkdir -p ~/eclipse/servers && cd ~/eclipse/servers
WILDFLY_RELEASE=$(curl -s https://api.github.com/repos/wildfly/wildfly/releases/latest|grep tag_name|cut -d '"' -f 4)
wget https://github.com/wildfly/wildfly/releases/download/${WILDFLY_RELEASE}/wildfly-${WILDFLY_RELEASE}.tar.gz
Extract the file once it is downloaded:
tar xvf wildfly-${WILDFLY_RELEASE}.tar.gz
After that, we add an administrator to manage some sources such as data sources.
cd wildfly-*.Final/bin/
./add-user.sh
Follow instructions as shown below to fill the questions:
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): a
Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : admin
User 'admin' already exists and is disabled, would you like to...
a) Update the existing user password and roles
b) Enable the existing user
c) Type a new username
(a): a
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
- The password should be different from the username
- The password should not be one of the following restricted values {root, admin, administrator}
- The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password : <INPUT-PASSWORD>
Re-enter Password :<RETYPE-PASSWORD>
After the configuration, start your WildFly server instance in standalone as follows:
$ ./standalone.sh
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /home/jkmutai/wildfly-29.1.1.Final
JAVA: java
JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED
=========================================================================
18:19:50,732 INFO [org.jboss.modules] (main) JBoss Modules version 2.0.2.Final
18:19:51,163 INFO [org.jboss.msc] (main) JBoss MSC version 1.4.13.Final
18:19:51,169 INFO [org.jboss.threads] (main) JBoss Threads version 2.4.0.Final
When the server is running, the web management interface can be accessed at http://localhost:9990/console. You can use the web management interface to create datasources, manage deployments and configure the server.
Adding WildFly (JBoss) to Eclipse IDE
Bring up your eclipse IDE then go to Help > Install New Software… > Work with:
Click Add to add JBoss Tools plugin:
Name: JBoss Tools
Location: http://download.jboss.org/jbosstools/photon/development/updates/
Select the features you will need. Then click Finish and Restart
After restart click the servers tab. Mostly it will be blank with a link to create a server. Click the link to bring up a window for configuring the server.
Select WildFly from the Jboss Community list. Click Next then set the Home directory of the installed WildFly. The rest will be configured for you. Click Finish.
Test WildFly to Eclipse IDE integration
Create a simple project to test your server. It should now work!
Thanks and have a nice day!.
Check other Dev related guides available in our blog.
- Install GCC and Development Tools on RHEL 8 / CentOS 8
- How to install Chef Development Kit / Workstation on Ubuntu
- How To Provision VMs on oVirt / RHEV with Terraform