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
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

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

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

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • From J2EE to Jakarta EE
  • Getting Started With Jakarta EE and Eclipse MicroProfile
  • A Systematic Approach for Java Software Upgrades
  • Simplify NoSQL Database Integration in Java With Eclipse JNoSQL 1.1.3

Trending

  • Agile and Quality Engineering: A Holistic Perspective
  • How Trustworthy Is Big Data?
  • Beyond Code Coverage: A Risk-Driven Revolution in Software Testing With Machine Learning
  • FIPS 140-3: The Security Standard That Protects Our Federal Data
  1. DZone
  2. Coding
  3. Java
  4. Java 9 on Java EE 8 Using Eclipse and Open Liberty

Java 9 on Java EE 8 Using Eclipse and Open Liberty

Here we take a look at how to get started with Java 9 using Java EE 8 in Eclipse and Open Liberty for those looking to get started with this combo.

By 
Martin Farrell user avatar
Martin Farrell
·
Updated Dec. 18, 17 · Tutorial
Likes (16)
Comment
Save
Tweet
Share
22.0K Views

Join the DZone community and get the full member experience.

Join For Free

I wrote a post a few weeks ago titled Which IDE’s and Server’s support Java EE 8 and Java 9, which looked at the current state of play between Java 9 and Java EE 8. As you would expect things have moved quickly and we now have some alpha and development builds supporting Java 9 and Java EE 8. These are –

  • Payara 5 – for payaradomain
  • Open Liberty

Adam Bein posted a video, Java EE 8 on Java 9, on how to deploy a Java 9 application on Open Liberty using netbeans. It's a great video and worth a look.

I decided to use the same approach as Adam to deploy a JSF Application on Eclipse Oxygen.

This post deals with installation and the first part of the project installing the core application, the next post will expand on this by building a JSF 2.3 application.

Java 9

Ensure you are running Java 9 on both classpath and JAVA_HOME, and also ensure you have maven installed.

Image title

dos prompt.

Open Liberty

Open Liberty came from IBM open sourcing WebSphere Liberty and is a fully compliant Java EE 7 server. They also have an early release Java EE 8 server, which is getting improved all the time in their development builds. We will use a development build for this project, which can be downloaded from –

Image title

Open Liberty Development Download.

Eclipse

Eclipse Oxygen also has Java 9 release available here – I am using the Java EE version of Eclipse.

Image title

Eclipse download.

Work through the installation instructions. This is just unzipping Open Liberty Server to your preferred location, and similarly for Eclipse Oxygen

Start Eclipse Oxygen –

Image title

Eclipse Oxygen.

Installing Open Liberty on Eclipse Oxygen

Finally, we need to install “IBM Liberty Development Tools for Oxygen” – Help > Eclipse Marketplace.

Image title

IBM Liberty Developer Tools for Oxygen.

Then connect up our Open Liberty server on the Servers tab.

Image title

Finally, point at your Open Liberty deployment location, and ensure you are using Java 9 –

Image title

You can click finish here.

Finally, we need to install the Java EE 8 Feature –

  • Double Click “WebSphere Application Server Liberty”

Image title

  • Click “Open server configuration” then “Feature”

Then “Add…” and select “javaee-8.0”

Image title

I'd also remove JSF 2.3 as that's included in javaee-8.0.

You could start the server now if you want.

First Project

The best archetype I've found for Java EE 8 is also from Adam Bein.

To run it, simply type –

mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=com.airhacks -DarchetypeArtifactId=javaee8-essentials-archetype -DarchetypeVersion=0.0.2 -DgroupId=com.javabullets.javaee8 -DartifactId=javaee8

Then, let's compile straightaway and make sure there are no errors –

E:\code\javaee8>mvn clean package

Note the archetype is compiled against Java 8; we will move it to Java 9 in the next section.

The source code is available at https://github.com/farrelmr/javaee8.

Open in Eclipse

In “Enterprise Explorer” select Import > Import… > Maven > Existing Maven Projects.

Navigate to your Java EE 8 directory, click Finish and let Eclipse load your project into Eclipse.

Open the pom.xml file and change source and target from 1.8 to 1.9 –

<properties>
    <maven.compiler.source>1.9</maven.compiler.source>
    <maven.compiler.target>1.9</maven.compiler.target>
    <failOnMissingWebXml>false</failOnMissingWebXml>
</properties>

Then run maven (right-click the project > Run As… > maven install).

Add Project to Open Liberty

Go to Servers > “WebSphere Application Server Liberty” > Right Click “Add and Remove…”

Image title

  • Move our javaee8 application from Available to Configured
  • Press Finish

Start Open Liberty

Servers > “WebSphere Application Server Liberty” > Right Click “Start”

You will get an error message about setting a keystore. I am just canceling this as its used by the “local connector” feature. I've not found a way to clear this error on Eclipse – but will post when I have.

The server will start and you can access the pre-installed application on http://localhost:9080/javaee8/resources/ping:

Image title

Woohoo, Running Java 9 on Java EE 8 Open Liberty!

This post uses Adam Bein’s approach to running Java 9 on Java EE 8 Open Liberty – but demonstrates how you can integrate this into Eclipse Oxygen. The next post will build on this archetype to create a simple JSF 2.3 application

Finally, I think it is great to see the progress being made to provide Java EE 8 on Java 9, and would like to thank the developers involved in this work.

Java EE Java (programming language) Eclipse

Published at DZone with permission of Martin Farrell, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • From J2EE to Jakarta EE
  • Getting Started With Jakarta EE and Eclipse MicroProfile
  • A Systematic Approach for Java Software Upgrades
  • Simplify NoSQL Database Integration in Java With Eclipse JNoSQL 1.1.3

Partner Resources

×

Comments

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: