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 Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
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
  1. DZone
  2. Coding
  3. Frameworks
  4. Working With Java 9 in Eclipse

Working With Java 9 in Eclipse

With Java 9 fast approaching, we take a look at how to get your instance of Eclipse ready to handle working with the upcoming version of Java.

Brian Fernandes user avatar by
Brian Fernandes
·
Aug. 25, 17 · Tutorial
Like (13)
Save
Tweet
Share
23.93K Views

Join the DZone community and get the full member experience.

Join For Free

The Java 9 general availability release is just under a month away, but the builds available right now are already feature complete. If you can’t wait to try some Java 9 capabilities, you can start developing with Java 9 in Eclipse right now!

Installing the Java 9 Support

  1. You need an Oxygen-based install of Eclipse – ensure you’re using the R version and not milestone or integration builds.
  2. Open the Java 9 Support marketplace entry in a browser: https://marketplace.eclipse.org/content/java-9-support-beta-oxygen
  3. Drag and drop the Install button from the webpage into your Eclipse IDE to start the installation.  java9blog1

Note: In the unlikely event that the above steps don’t work, you probably do not have the Eclipse Marketplace Client installed – you can then choose Help > Install New Software… and use the following update site in the wizard to install the Java 9 patch: http://download.eclipse.org/eclipse/updates/4.7-P-builds

Using Java 9

It goes without saying that you must have a recent Java 9 JRE or JDK installed. If you don’t, get it here: http://jdk.java.net/9/

The first thing to do is to set up your workspace to use a Java 9 JRE.

java9blog2


Now when you create a project, use the JavaSE-9 execution environment, or select the specific JRE you created in your previous step.

java9blog3

Once your project is created, you have the freedom to do everything from creating and using modules to exploring the new Collections API or using one of my favorite features, the new additions to the Process API.

java9blog4

java9blog5


And by the way, if you are wondering why my Eclipse dark theme looks so cool, it’s the Darkest Dark theme.

Note that you don’t need to run Eclipse itself with Java 9 to be able to use Java 9 for development, or even to execute Java 9 applications and JUnit tests. However, if you do want to do this, please read this article. For more examples of Eclipse’s Java 9 support, see this page.

Java 9 Highlights

Module System

A module is a named, self-describing collection of code and data – the JDK itself has been divided into a set of modules. What does this mean? Improved performance by using only the parts of the JDK, or a modularized third-party library that you need. Better maintainability of your own complex code; with modules you have better encapsulation, can cleanly expose APIs, and have explicitly declared dependencies.

Private Interface Methods

An extension of the default methods introduced in Java 8, the private interface methods make it easy to share code within interfaces while keeping it unexposed.

Factory Methods for Collections

Want to create an immutable collection easily? You no longer need several add statements. Try this: 

List<String> myList = List.of(“one”, “two”, “three”);


Process API Improvements

Sick of using third-party libraries, or even executing shell scripts to do something as simple as getting the PID of a process? I know I am. With Java 9, that’s now a thing of the past with the ProcessHandle#pid method. There are several other improvements here that allow better Java <> OS interaction too.

There are several other key features, like HTTP /2 support, multi-release JARs, a better Stream API, improved Javadocs, and Applets (remember them?) are finally getting deprecated. These are just my highlights. For an exhaustive list, have a look at Oracle’s what’s new document.

Java (programming language) Eclipse

Published at DZone with permission of Brian Fernandes, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • A Brief Overview of the Spring Cloud Framework
  • ChatGPT: The Unexpected API Test Automation Help
  • How To Check Docker Images for Vulnerabilities
  • Express Hibernate Queries as Type-Safe Java Streams

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: