Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Configure Eclipse for Java 9

Page is Under Construction

This wiki page explains how you can configure Eclipse to launch with Java 9

Configure Eclipse for Java 9

Download Java 9

You need to download and install a Java 9 VM, e.g. from https://jdk9.java.net/.

Configure Eclipse to run on Java 9 VM

Unless you have Java 9 on your system path, you need to specify the use of your Java VM. If you already do this, simply replace it with a Java 9 VM. Otherwise it can easily be done by adding something like:

-vm
C:\Program Files\Java\jdk-9\bin\javaw.exe

following the --launcher.appendVmargs line to the eclipse.ini.

Configure Eclipse for Java 9 modules

Since the Eclipse SDK uses types that aren't in the java.base module, you need to add the following vmargs to eclipse.ini:

--add-modules=ALL-SYSTEM

Your project might fail to run because you use types that are neither in java.base or java.se.ee, e.g. types from javafx.base. In that case you have to figure out which module(s) you need to add with --add-modules.

  • Only works in JDK 8, but not in JDK 9: Run jdeps fully.qualified.classname
  • In Eclipse with Java 9 Support (BETA) for Oxygen (see below), you can open the type in a JavaSE-9 JRE and perform Show In > Package Explorer. Inside the "JRE System Library" node, the Package Explorer will show the module in which that type resides.

If you encounter an exception such as IllegalAccessException or InaccessibleObjectException, add following after -vmargs in eclipse.ini:

 --permit-illegal-access

eclipse.ini summary

Your eclipse.ini should contain something like:

--launcher.appendVmargs
-vm
C:\Program Files\Java\jdk-9\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
--add-modules=ALL-SYSTEM
--permit-illegal-access


Note: Java 9 is still in early access, and hence the options are yet to be stable. It is possible that the info given here will change over time. Currently verified with Java 9 EA 169. Page is still under construction

Back to the top