Installation Eclipse with Java 9

Java 9 has been released recently. The upcoming posts will be dedicated to Java 9 and the new features it has to offer. First post in this series is installation of Eclipse with Java 9. If you are using IntelliJ, just install IntelliJ, locate the java 9 SDK and you can start right away.

  1. Download Eclipse Oxygen from the Eclipse website: https://www.eclipse.org/downloads/
  2. Install Eclipse at a location of your choice.
  3. Download the JDK 9 from the Oracle website: http://www.oracle.com/technetwork/java/javase/downloads/index.html
  4. Of course, install the JDK 9 on your computer.
  5. At the following website, you can find more information about the JDK 9: http://docs.oracle.com/javase/9/index.html
  6. At this point, JDK 9 is now my default java version (cmd: java -version). But I just want to wait a little bit before I set JDK 9  as the default. In my path the following is set: C:\ProgramData\Oracle\Java\javapath . I have added the path to my JDK 8 installation before the default entry: c:\Program Files\Java\jdk1.8.0_144\bin\ in order to let JDK 8 to be the default. For some reason I had to reboot before it had any effect (closing and opening a new command window did not work…).
  7. Now start Eclipse and choose a workspace to work from.
  8. We have to set the JDK 9 as the default JDK in Eclipse.
  9. Go to Windows – Preferences – Java – Installed JREs and add the installation path of your JDK 9 installation to the installed JREs, After selecting the installation directory, the following error is shown:
    eclipsejdk9error
  10. I have added –add-modules=ALL-SYSTEM to the eclipse.ini and restarted Eclipse, but the same error is shown.
  11. I have installed the Java 9 support for Oxygen plugin from the Eclipse Marketplace, but during the installation a new error shows up:
    java9supportforoxygenerror
  12. I choose ‘Update my installation to be compatible with the items being installed’, the installation continues.
  13. After restarting Eclipse, it is possible to add the JDK 9 and to set is as default.
  14. Create a new Java Project.
  15. Create a dummy class with a Main method and check whether the JDK 9 features are available. F.e. check whether you can access Set.of(). If the code completion sees this method, JDK 9 is enabled.
  16. At this point, we are ready to explore the JDK 9 features!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.