3

After issuing apt-cache search jdk, I see both openjdk-8-jdk and openjdk-9-jdk listed. I am unsure which one I should install.

I took a look at SDK downloads from Oracle's website below, and I wasn't able to immediately find SDK 9. Why would this be the case?

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

flow2k
  • 133
  • 1
  • 4

2 Answers2

3

Java 9 is still in development. You can find official downloads of it at http://jdk.java.net/9/. Which version you should download is entirely a a question of what you plan to do with it.

Edit: It has been officially released on 2017 Sep.

muru
  • 197,895
  • 55
  • 485
  • 740
3

If you are planning to install NetBeans then install openjdk-8-jdk because openjdk-9-jdk is not compatible with NetBeans from the default Ubuntu repositories, at least it is not compatible with NetBeans in Ubuntu 16.04. The version of NetBeans in 16.04 is NetBeans 8 which targets Java 8 as its compatible Java version. NetBeans from the default Ubuntu 18.04 and later repositories, is compatible with openjdk-11-jdk.

Another alternative is to install both openjdk-8-jdk and openjdk-9-jdk and use either update-alternatives --config java (update-alternatives is provided by default by dpkg in Ubuntu) or update-java-alternatives (which is installed when openjdk-8-jdk is installed) to manually choose which Java to use before running an application. See update-java-alternatives vs update-alternatives --config java.

karel
  • 114,770