Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Configure Eclipse for Java 9"

m
m
Line 1: Line 1:
 +
Page is Under Construction
 +
 
This wiki page explains how you can configure Eclipse to launch with Java 9
 
This wiki page explains how you can configure Eclipse to launch with Java 9
  
Line 20: Line 22:
 
* 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.
 
* 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.
  
Since the Eclipse SDK uses types that aren't in the java.base module, you need to add the following vmargs to eclipse.ini:
+
If you encounter an exception such as IllegalAccessException or InaccessibleObjectException, add following after -vmargs in eclipse.ini:
'''--add-modules=ALL-SYSTEM'''
+
If you encounter an exception such as IllegalAccessException or InaccessibleObjectException, additionally following -vmargs add in eclipse.ini:
+
 
   '''--permit-illegal-access'''
 
   '''--permit-illegal-access'''
  

Revision as of 05:19, 2 June 2017

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

Page is still under construction

Back to the top