Home » Desktop Java » IDE » Eclipse » Eclipse with Wildfly and JBoss Tools Example

About Joel Patrick Llosa

Joel Patrick Llosa
I graduated from Silliman University in Dumaguete City with a degree in Bachelor of Science in Business Computer Application. I have contributed to many Java related projects at University of Southampton (iSolutions), Predictive Technologies, LLC., Confluence Service, North Concepts, Inc., NEC Telecom Software Philippines, Inc., and NEC Technologies Philippines, Inc. You can also find me in Upwork freelancing as a Java Developer.

Eclipse with Wildfly and JBoss Tools Example

1. Introduction

In this example, we will build a simple Java EE web project, also known as a “hello world” Java EE web application. We will be using Eclipse with Wildfly and JBoss Tools. First and foremost, let’s install the following:

For WildFly, we’ll use the Java EE Full and Web Distributioin. Follow the respective instructions in installing the above tools.
This example was built using a Windows 10 machine with Eclipse Oxygen.3a Release, WildFly 10.1.0.Final and JBoss Tools 4.5.3.Final.

2. Development Environment Setup

After installing JBoss Tools, we will see the Welcome to Red Hat page when we start up Eclipse.

Eclipse with Wildfly and JBoss Tools - Welcome to Red Hat page

Welcome to Red Hat page

Next, let’s add WildFly to Eclipse. Right-click on the Servers tab, New -> Server. Pick WildFly 10.x.

Eclipse with Wildfly and JBoss Tools - Add WildFly Server to Eclipse

Add WildFly Server to Eclipse

Click Next. In the Create a new Server Adapter dialog, tick The server is “Local” and Controlled by “Filesystem and shell operations”. Click Finish.

We should have WildFly 10.x in our Servers tab now. Double click the WildFly 10.x Server to open the WildFly 10.x Overview tab and click on the Runtime Environment.

Eclipse with Wildfly and JBoss Tools - WildFly Overview Tab

WildFly Overview Tab

In the JBoss Runtime dialog, set up your home Directory to point to your WildFly directory, keep the defaults and click Finish.

Eclipse with Wildfly and JBoss Tools - JBoss Runtime

JBoss Runtime

We can now start and stop the WildFly server. Right-click on the server to start/stop it. By default, it is accessible at http://localhost:8080 where we can see a Welcome to WildFly 10 web page.

3. Eclipse with WildFly and JBoss Tools Configuration Tips

Here are some additional configuration tips for Eclipse with WildFly and JBoss Tools. Some of these configuration tips are not specific to Eclipse with WildFly and JBoss Tools development and can also be used in other Java development projects.

  1. Double-click on the server name to open the WildFly Overview tab. Uncheck the “Use default pattern” under the Application Reload Behavior section and use this pattern \.jar$|\.class$. This will reload our application whenever our class or jar files are changed. Please see the WildFly Overview Tab image above.
  2. Windows -> Preferences – > General -> Editors -> Text Editors. Set Show print margin and print margin column to 120. This is a helpful indicator to not go beyond the 120 characters width.
    Eclipse with Wildfly and JBoss Tools - Preferences Text Editors

    Preferences Text Editors

  3. Windows -> Preferences – > General -> Editors -> Text Editors -> Spelling. Disable spell checking. We are not writing a novel here.
  4. Windows -> Preferences – > Java -> Editor -> Save Actions. Tick the “Perform the selected actions on save”, “Organize imports”, and “Additional actions”.
    Eclipse with Wildfly and JBoss Tools - Java Editor Save Actions

    Java Editor Save Actions

  5. General -> Workspace. Set Text file encoding to UTF-8. Why UTF-8? Because it can support every language on the planet. Set New text file line delimiter to Unix if you work on different operating systems.
    Eclipse with Wildfly and JBoss Tools - General Workspace

    General Workspace

  6. Windows -> Preferences – > Java -> Editor -> Save Actions -> Configure. Under the Code Organizing tab, tick Remove trailing whitespace. Under the Code Style tab, tick Use blocks in if/while/for/do statements. Under the Member Accesses tabs, tick declaring class as qualifier. Under the Unnecessary Code, tick Remove unused imports.
    Eclipse with Wildfly and JBoss Tools - Additional Save Actions

    Additional Save Actions

  7. Windows -> Preferences – > Java -> Installed JREs. Add and select the JDK.
    Eclipse with Wildfly and JBoss Tools - Java Installed JREs

    Java Installed JREs

  8. Windows -> Preferences – > Web -> CSS Files and in HTML Files. Set Encoding to UTF-8.
    Eclipse with Wildfly and JBoss Tools - Preferences Web CSS Files

    Preferences Web CSS Files

  9. Windows -> Preferences – > Web -> JavaServer Faces Tools -> Validation -> Type Coercion Problems. Set Unary operation number corection problems and Unary operation boolean coercion problems to Ignore.
    Eclipse with Wildfly and JBoss Tools - JavaServer Faces Tools Validation

    JavaServer Faces Tools Validation

  10. Windows -> Preferences – > Web -> JavaServer Faces Tools -> Validation -> Type Assignment Problems. Set Method expression signature incompatibility to Ignore. See JavaServer Faces Tools Validation image.

4. A Simple Java EE Web App using Eclipse with WildFly and JBoss Tools

Our Eclipse IDE is now ready for some Java EE development. Let’s create our first “hello world” Java EE Web Project. Open Red Hat Central, click the guy with a red hat and click on the Java EE Web Project. Follow the instructions and this defaults to a jboss-javaee-webapp project name. Click Next -> Finish. After your project has been created, right-click -> Run As -> Run on Server and choose WildFly. YoWe should see something like below. Let us give thanks to JBoss Tools because this project has stub code in it. Thank you Red Hat!

Eclipse with Wildfly and JBoss Tools

Eclipse with WildFly and JBoss Tools

5. Eclipse with WildFly and JBoss Tools Summary

In summary, the first thing we did was install Eclipse. Next, we installed WildFly and integrated to Eclipse. Then we installed JBoss tools and made some configuration tweaks on Eclipse to make development easier. Finally, we created our sample project with the help of JBoss tools by clickin on the Java EE Web Project link which gave us a Java EE Maven project.

6. Download the Source Code

This is an example of Eclipse with WildFly and JBoss Tools.

Download
You can download the source code of this example here: jboss-javaee-webapp.zip.
(+1 rating, 1 votes)
4 Comments Views Tweet it!

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

 

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

6. Spring Interview Questions

7. Android UI Design

 

and many more ....

 

Receive Java & Developer job alerts in your Area

 

4
Leave a Reply

avatar
2 Comment threads
2 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
3 Comment authors
Birkan GencJoel Patrick LlosaFidoris Shine Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Fidoris Shine
Guest
Fidoris Shine

It is a very nice detailed javaee web setup tutorial, thanks so much for your contribution!

Birkan Genc
Guest
Birkan Genc

Just what I needed. Thumbs up!