2

I'm brushing up on Java, working from the Deitel book Java 9 For Programmers. The first 15 chapters required Java SE 8, and I remember the installation process being an easy command-line job - sudo apt-get install ... etc.

At the end of Chapter 16 comes the first example requiring Java 9, which has brought my progress to a halt. I have spent nearly 2 hours this evening trying to find a way to install OpenJDK 9. The error is:

E: Unable to locate package openjdk-9-jdk

The biggest difficulty seems to be finding any results for this exact error. There are numerous posts on altogether different kinds of OpenJDK 9 install problems, although most search results are for OpenJDK 8. Several posts advise using the command I used - sudo apt-get install openjdk-9-jdk. I've made sure the universe, multiverse repositories are on, sudo apt-get update etc., but no joy.

Can one install JDK 9 on Ubuntu?

PaulS
  • 31
  • JDK 9 is not supported anymore. Please use JDK10 instead. It should be backwards compatible. https://en.wikipedia.org/wiki/Java_version_history – Ward Segers May 30 '18 at 21:24

1 Answers1

5

JDK 9 is not supported anymore. You should use JDK 10 (or any newer version available) More details on the Wikipedia page of the Java Version history.

To do this, install the default-jdk package.