How do I integrate WildFly with Eclipse? This tutorial shows how to do it, by installing the JBoss Tools plugin on Eclipse so that you can manage e local or remote WildFly application server without leaving your favourite IDE.
Installing JBoss Tools
In order to install JBoss Tools make sure you have installed the latest Eclipse release. Next, move to the Help | Eclipse Market Place and 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 following screen select the “JBoss AS, WildFly & EAP Server tools” plug-in and restart Eclipse once completed.
Next, choose from the upper Menu: File | New | Server and expand the JBoss Community option. You will see the “WildFly” Server is available:
In the current version of JBoss Tools plugin for eclipse you will see as latest version “WildFly 24+“. You can obviously use that for any release equal or greater than WildFly 24. In most cases, there is no strict requirement to match the exact server version.
Next, you have to choose if the Server is locally installed (Local) or it’s a remote server (Remote) and how you are managing the Server Lifecycle:
Finally, point to the installation folder of the following items:
- WildFly Home directory
- Runtime JRE that you will use for the execution
- Server base directory and configuration file name
The following picture shows the above options::
Click Finish. The configuration of WildFly in Eclipse is complete!
Click on the Icons in the toolbar to Debug / Start / Profile / Stop your Server. Right click on it and choose “Add or Remove ” to Deploy applications on it.
If you want to learn how to debug remotely WildFly with eclipse check this article: How to debug remotely WildFly
Running JBoss Tools with Java 16 or newer
Since Java 16 all Java internals are by default strongly encapsulated. This forbids external access from reflection. In particular, you will see exceptions for modules that are attemempting to initialize Classes via reflection. Example:
Could not initialize class org.wildfly.security.auth.client.DefaultAuthenticationContextProvider
To circumvent this issue you need to open the above module for external access.
Make sure that eclipse.ini includes the following option, which will be added to the JVM startup parameters:
Sometimes your application server requires to deploy a large number of artifacts, which in turn might access external resources. Therefore, it is common that the server start up will take some time.
How to avoid the start up limit in Eclipse
Sometimes your application server configuration requires some time to complete the start-up. Here is what could happen when you try to start the application server from Eclipse:
To overcome this limit you have two options:
- Double click on the server icon (In the Servers tab). In the next panel choose an appropriate timeout for your server.
In this tutorial, we covered the steps required to configure Eclipse to use Wildfly. We installed Wildfly, installed the JBoss Tools plugin for Eclipse, created a new server, configured the server, and started the server. With these steps, you should now be able to use Eclipse to develop and deploy applications on the Wildfly server.