Ubuntu – Install Java version 8 on Ubuntu 16.04

16.04javasoftware installation

I'm on Ubuntu 16.04 and need to install java version 8 (or 9).

I did: sudo apt-get install openjdk-8-jdk

But when I check current version using java -version, the result is:

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

What am I doing wrong?

Best Answer

  • You have installed OpenJDK correctly. Java 8 and Java 1.8 are one and the same thing. It is just a naming convention as explained in this post on Quora.

  • Related Question