DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Getting Started With Jakarta EE and Eclipse MicroProfile
  • Managed Scheduled Executor Service vs EJB Timer
  • Java High Availability With WildFly on Kubernetes
  • A Systematic Approach for Java Software Upgrades

Trending

  • Start Coding With Google Cloud Workstations
  • MCP Servers: The Technical Debt That Is Coming
  • IoT and Cybersecurity: Addressing Data Privacy and Security Challenges
  • A Deep Dive Into Firmware Over the Air for IoT Devices
  1. DZone
  2. Coding
  3. Java
  4. Getting Started With Java EE 8, Java 11, and Eclipse for Enterprise Java and Wildfly 16

Getting Started With Java EE 8, Java 11, and Eclipse for Enterprise Java and Wildfly 16

Need help getting started with Eclipse for Enterprise Java?

By 
Víctor Orozco user avatar
Víctor Orozco
·
Jun. 05, 19 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
30.5K Views

Join the DZone community and get the full member experience.

Join For Free

If you have been in the Java EE space over the last few years, Eclipse IDE for Java Enterprise Developersis probably one of the best IDE experiences, making the creation of applications with important EE components like CDI, EJB, JPA mappings, configuration files, and good interaction with some of the important application servers (TomEE, WebLogic, Payara, Wildfly, JBoss).

In this line, Red Hat develops the Eclipse variant "CodeReady Studio," providing you with an IDE that supports Java Enterprise frameworks, Maven, HTML 5, Red Hat Fuse, and OpenShift deployments.

To give support to its IDE, Red Hat also publishes CodeReady plugins as an independent project called JBoss Tools, enabling custom Enterprise Java development environments with Eclipse IDE for Java Enterprise developers, which is what we will demonstrate in this tutorial.

Why? Just for fun. Or, in my case, I don't use the entire toolset from Red Hat.

Requirements

In order to complete this tutorial, you will need to download/install the following elements:

1. Java 11 JDK from Oracle or any OpenJDK distro
2. Eclipse IDE for Enterprise Java Developers
3. Wildfly 16

Installing OpenJDK

Since this is an OS/distribution-dependent step, you could follow tutorials for Red Hat's OpenJDK, AdoptOpenJDK, Ubuntu, etc. At this time, Wildfly has Java 11 as a target due to new Java-LTS version scheme.

For MacOS, one convenient way is AdoptOpenJDK tap.

First, you need to install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


After that, and if you want a specific Java version, you should add AdoptOpenJDK tap and install it from there. For instance, if we like an OpenJDK 11 instance, we should type:

brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk11


If all works as expected, you should have a new Java 11 environment running:

Java 11

Eclipse IDE for Enterprise Java Developers

Eclipse offers collections of plugins-denominated Packages; each package is a collection of common plugins aimed for a particular development need. Hence, to simplify the process, you can download Eclipse IDE for Enterprise Java Developers directly.

Eclipse Enterprise

On Mac, you will download a convenient .dmg file that you can drag and drop into the Applications folder.

Eclipse Install

The result is a brand new Eclipse installation with Enterprise Java (Jakarta EE) support.

Eclipse IDE

JBoss Tools

To install the "Enterprise Java" features to your Eclipse installation, go to JBoss Tools main website at https://tools.jboss.org/ — you should double check the compatibility with your Eclipse version before installing. Since Eclipse is launching new versions each quarter, the preferred way to install the plugins is by adding the updated URL.

First, go to:

Help > Install New Software… > Work with:


And add the JBoss Tools URL http://download.jboss.org/jbosstools/photon/development/updates/

JBoss Repo

After that, you should select the individual features, a minimal set of features for developers aiming Jakarta EE is:

  • JBoss Web and Java EE Development: Support for libraries and tools like DeltaSpike, Java EE Batch, Hibernate, JavaScript, JBoss Forge
  • JBoss Application Server Adapters: Support for JBoss, Wildfly and OpenShift 3
  • JBoss Cloud and Container Development Tools: Support for Vagrant, Docker, and Red Hat Containers development kit
  • JBoss Maven support: Integrations between Maven and many EE/JBoss APIs

JBoss Tools

Finally, you should accept licenses and restart your Eclipse installation.

Wildfly 16

Wildfly distributes the application server in zip or tgz files. After getting the link you could do the install process from the CLI. For example, if you wanna create your Wildfly directory at  ~/opt/, you should execute the following commands:

mkdir ~/opt/
cd ~/opt/
wget https://download.jboss.org/wildfly/16.0.0.Final/wildfly-16.0.0.Final.zip
unzip wildfly-16.0.0.Final.zip


It is also convenient to add an administrative user that allows the creation of DataSources, Java Mail destinations, etc. For instance, and again using ~/opt/ as a basis:

cd ~/opt/wildfly-16.0.0.Final/bin/
./add-user.sh

Wildfly Admin

The script will ask basic details like username, password, and consideration on cluster environments; in the end, you should have a configured Wildfly instance ready for development. To start the instance, just type:

~/opt/wildfly-16.0.0.Final/bin/standalone.sh


To check your administrative user, go to http://localhost:9990/console/index.html.

Wildfly Dashboard

Eclipse and Wildfly

Once you have it all set, it is easy to add Wildfly to your Eclipse installation. Go to servers window and add a new server instance, the wizard is pretty straight forward, so screenshots are added for reference:

Wildfly 16

Wildfly 16 local

Wildfly Home

If you wanna go deep on server's configuration, Eclipse allows you to open the standalone.xml configuration file directly from the IDE, just check if the application server is stopped, otherwhise your configuration changes will be deleted.

Wildfly Standalone

Testing the Environment

Check your pom.xml for Java 11 capabilities, specifically Maven compiler source configuration. The complete pom.xml file should be similar to this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.nabenik</groupId>
    <artifactId>eetest</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>8.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <finalName>eetest</finalName>
    </build>
    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </properties>
</project>


Since the IDE and application server are compatible with Java 11, it is possible to use local type inference in JAX-RS.

To test this application, I've created a nano-application using an Archetype for Java EE 8. The application server and IDE support Java 11, and the deployment works as expected directly from the IDE.

Wildfly EE


And there you have it! Hope you enjoyed.

Java (programming language) Eclipse Java EE WildFly JBoss application Application server Integrated development environment JBoss Tools Docker (software)

Published at DZone with permission of Víctor Orozco. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Getting Started With Jakarta EE and Eclipse MicroProfile
  • Managed Scheduled Executor Service vs EJB Timer
  • Java High Availability With WildFly on Kubernetes
  • A Systematic Approach for Java Software Upgrades

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!