• Share this article:

Eclipse Platform on Java 9 b118

Wednesday, May 18, 2016 - 14:34 by Wayne Beaton

Update: Note that as of October 11/2017, Java 9 is 100% supported “out of the box” by Eclipse IDE, Oxygen Edition; Java 9 can be used to run your Eclipse IDE, Oxygen Edition, and can be used to build Java 9 applications without additional configuration. Download or update today.

I’d taken a little break from testing Eclipse Platform on Java 9 Jigsaw builds. A few nights ago, I pulled down the latest builds of both and gave them a spin.

I pulled down build 118 of the 64 bit Linux version of the Java 9 JDK. The last time I did this, the Jigsaw builds were separate, but they’ve since replaced the Java 9 builds, so when you download Java 9 you now get Jigsaw. It’s currently delivered as a .tar.gz file, so I extracted it into a directory on my system.

I then turned my attention to the Eclipse Installer which has a handy feature that hunts down JREs installed on your system and lets you pick the one that you want to use. It also has a handy feature that lets you manually add JREs to the list. The installer includes some logic to help the user avoid making a poor choice, and changes in the way that the JRE reports its version means that the installer doesn’t recognise this particular version of the JRE as a JRE and won’t let you select it (see Bug 493759). I decided to install the latest Neon M7 build anyway using a Java 8 JRE. I launched my newly-installed configuration.

I added the Java 9 Support (Beta) feature from the Eclipse Marketplace. You can install it yourself by simply dragging and dropping the “Install” button below onto your Neon version of Eclipse Platform:

Drag to your running Eclipse workspace to install Java 9 Support (BETA) for Neon

The last time I tested this, I needed to have Eclipse JDT run on the Java 9 JRE to use the Java 9 support; but now, the Java 9 support seems to work just fine when running the Eclipse JDT on a Java 8 runtime. The JDT team has done some significant work, it seems, since I last looked.

I added the Java 9 JRE to the Installed JREs page in the preferences and was able to create and run a Java 9 application.

InstalledJREs

The bits that I tested all seem to work as expected; e.g. the Package Explorer lists modules.

Java9App

I only spent a few minutes poking around before moving on to the next task: I wanted to get the Eclipse Platform itself running on this Java 9 build.

I tweaked the eclipse.ini file to point to the Java 9 JVM, by adding the path to the JVM at the top of the file:

-vm
/home/apps/jdk-9/bin

I launched the Eclipse Platform and got as far as selecting the workspace before it died with a message to check the log. I opened Bug 493761. The JDT team engaged within hours. Tom Watson (from the Equinox project team) determined that a change in the boot classpath configuration is the cause and suggested as a workaround to add some additional configuration to the configuration file (after the -vmargs line) to ensure that the necessary modules are available.

-addmods
java.se.ee

For more information, see JEP 261. With that modification, everything works as expected.

The workaround is not optimal. For one, the Eclipse Platform fails to launch with this option when you launch under Java 8. The JDT team is looking for a better solution.

Your help is appreciated. If you have the time, please test this yourself and report any new information that you discover.