3

I am trying to explore Java 9 features with Eclipse Oxygen Version. I have downloaded the java 9 and Eclipse Oxygen version.

But when I try to create a new java project Java SE 1.9 is not available in the list of JRE Execution environment.

How to proceed further? Any help would be appreciated.

Choosing Runtime environment enter image description here

Choosing default JRE?? enter image description here

3 Answers3

2

Eclipse Oxygen (4.7.0) does not support Java 9. You can install a patch to add support from Eclipse market place see here

Eclipse Oxygen.1a (4.7.1a) is scheduled to be released on 11th October (2017) with full Java 9 support.

More details in the Eclipse wiki here

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • Thanks for your help. I have installed the latest patch. Still I am not able to see JRE 9 in the list. I am not able to choose default JRE as well. It says "Target is not a JDK root. System library not found". Attached image in the question regarding the issue that i face while choosing default JRE. –  Sep 28 '17 at 02:36
0

How to proceed further? Any help would be appreciated.

Try to make use of the option Use default JRE. Though this seems to be not configured on your machine currently.("Unknown")

You can try out the Java9 example and take a look at Greg's answer on how to support it with the current Eclipse version.

Note: For the patch to work with you would have to install java-9-support-beta-oxygen as well.

Naman
  • 27,789
  • 26
  • 218
  • 353
  • Without the patch I mention in my answer Eclipse does not recognise Java 9 as a JRE/JDK at all. – greg-449 Sep 27 '17 at 17:07
  • @greg-449 Agreed. Updated. – Naman Sep 27 '17 at 17:15
  • Thanks for your help. I have installed the latest patch which was given by @greg . I am not able to choose default JRE as well. It says "Target is not a JDK root. System library not found". Attached image in the question regarding the issue that i face while choosing default JRE. –  Sep 28 '17 at 02:36
  • 1
    @kamal Updated the answer. You would have to install java-9-support-beta-oxygen as well to use the patch. – Naman Sep 28 '17 at 02:52
0

After you have installed the Java 9 support for Eclipse Oxygen through the Marketplace you also have to edit your eclipse.ini. Eclipse has to be started through the Java 9 JDK, so add/change existing to:

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

You will also need an additional vmargs argument:

--add-modules=ALL-SYSTEM

After this you should be able to select a Java 9 JDK and it will be detected as such.

See eclipse wiki for detailed informations: https://wiki.eclipse.org/Configure_Eclipse_for_Java_9

Jochen Go
  • 21
  • 3
  • The [Java 9 support page](https://marketplace.eclipse.org/content/java-9-support-oxygen/) says "The Java™ 9 support also works when the IDE is launched with a Java™ 8 VM. There is no need to switch Java™ 9 VM for that." – kapex Oct 05 '17 at 09:12