Thursday, November 16, 2017

Upgrade JDK 8 to JDK 9 and steps to fix your application in Eclipse Oxygen

To install JDK 9 in windows (tested on Windows 10)
  1. Download JDK 9 from http://www.oracle.com/technetwork/java/javase/downloads/index.html. Current version when this note created is JDK 9.0.1.
  2. Follow installation instruction.
  3. In window system environment, set JAVA_HOME to JDK 9
    for example: JAVA_HOME = JAVA_HOME=C:\Java\jdk-9.0.1\
  4. In window system environment, set to path to JDK 9 binary folder
    for example Path=...;C:\Java\jdk-9.0.1\bin;...
To Install JDK 9 in Debian Stretch
  1. Add Backport repository to /etc/apt/sources.list
    # BACKPORT
    deb http://ftp.de.debian.org/debian stretch-backports main
  2. Install JDK 9 straight forward
    # apt-get install openjdk-9-jdk openjdk-9-jdk-headless openjdk-9-jre openjdk-9-jre-headless
Note:
  1. You can remove your JDK 8
  2. Android Studio 3 and earlier does not work with JDK 9. You may used JDK 8 that bundled in Android Studio 3 (tested on Android Studio 3 in Windows 10).
Your Eclipse Oxygen (version >= 1a) may be find with JDK 9, but you need to migrating your application library from JDK 8 to JDK 9 with these steps (tested on Windows 10):
  1. "Package Explorer" right click -> Properties
  2. "Java Build Path" -> Library (tab)
  3. Remove JRE System Library [JavaSE-1.8]
  4. Click "Add Library" botton
  5. "Add JRE System Library" -> Next -> "Workspace default JRE (jre-9.0.1)" -> Finish
  6. Click Apply botton
  7. Click Apply and Close botton 

Reference:

  • http://wiki.eclipse.org/Configure_Eclipse_for_Java_9 



No comments:

Post a Comment