In this tutorial we will cover all the steps to install Eclipse IDE. On the top of that, we will install the JBoss Tools so that we can start/stop/debug WildFly application server without leaving Eclipse.
First of all, let’s get to the Eclipse main download page which is at: https://www.eclipse.org/downloads/packages/
As you can see, there are multiple solutions for developing applications. The latest version of Eclipse, requires a simple installation on your machine. If you are interested in developing Enterprise application using an Eclipse Cloud Solution, then take a look at Eclipse Che: Develop your Enterprise applications on the Cloud with Eclipse Che
In this tutorial we will show how to use the latest version of Eclipse to get started with developing applications on JBoss EAP / WildFly and Eclipse.
Step 1: Install Eclipse
The first step is to download the Eclipse installer from: https://www.eclipse.org/downloads/
Run the eclipse installer:
$ eclipse-inst
Then, choose the version of Eclpse to install:
The “Eclipse IDE for Java Developers” will install a minimal version of the IDE for developing Java applications with Maven/Gradle integration. If you want some extra tooling for developing applications, such as JPA and Data Tooling, choose the “Eclipse IDE for Enterprise Java Developers”.
Once down with the download, launch eclipse.
Step 2: Install JBoss Tools
JBoss tools is a set of subprojects which are related to JBoss products: for example you can use JBoss AS Tools to create, deploy and debug applications on JBoss AS. For example, you can use the Hibernate tools to simplify mapping and querying your data with Hibernate.
Firstly, we will show how to install JBoss AS Tools on Eclipse. There are several ways to install Eclipse plugins: basically this boils down to intalling the plugin from within Eclipse environment and downloading and manually installing the tools. The simplest way to do it is through the Help | Eclipse Market Place:
From there, enter in the search box “jboss tools“. You will see several JBoss Tools releases available. Choose to install or update the latest stable JBoss Tools plugin:
In the next screen select the “JBoss AS tools” plugin and restart Eclipse once completed. Now choose from the upper Menu: File | New | Server and expand the JBoss Community option. A set of “WildFly” Servers are now available:
Next, choose if the Server is locally installed (Local) or it’s a remote server (Remote) and how to control the Server lifecycle:
Finally, specify the following settings:
- WildFly Home directory
- Location of Runtime JRE
- Server base directory and Configuration file
Example:
Click Finish. You have now configured WildFly on your Eclipse environment!
Useful Icons and Views
To manage the application server with ease, get familiar with the following icons in the Eclipse tool bar:
(1) Select the server version – in case you have installed multiple AS version
(2) Start the application server
(3) Debug the application server
Additionally, you can choose from the Menu: Window | Show View | Server
The following tab GUI will be accessible to start/stop/debug and deploy applications on JBoss AS.
Finally, let’s try to start the server. Right click on the Server icon and choose “Start” from the Menu.
The Console Tab GUI will activate, showing the server boot logs. At the end of the process, the Console will display f the server started correctly.
Deploying applications to JBoss AS / WildFly with Eclipse
Deploying an application is quite easy and just requires right clicking on the Server icon and choosing “Add and Remove“. In the next GUI choose a Java EE application project which will be deployed to JBoss AS and click on “Add” and “Finish“.
Fine. In a few seconds your application will be available on JBoss AS.
How to debug your applications running on JBoss AS / WildFly.
The simplest way to debug your Java EE applications on JBoss AS / WildFly is starting the server from within Eclipse in Debug mode. Simply right click on the Server icon and choose “Debug“. Once that the compiled code hits a breakpoint, the Debug perspective view will kick in.
The other way to debug, is called remote debugging and happens if you are running JBoss AS on a separate process. In order to remotely debug JBoss AS, set this properties in the AS start script (standalone.conf):
JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"
In the Debug configuration, create a new Remote Java Application node.
In the Connection Properties, specify localhost as the Host and specify the Port as the port that was specified in the run batch script of the JBoss server, 8787.
Please note that WildFly and JBoss EAP use deployment marker files to trigger deployment of applications. By default packaged archives are automatically deployed. On the other hand, exploded archives require a marker file named application.dodeploy to trigger deployment: for example if you are deploying an explodec application named Example.war, then you need creating a file Example.war.dodeploy in the deployments folder.