Ubuntu – Problems installing Java 8 onto Ubuntu 18.04 – Errors on oracle-java8-installer and java-common

18.04aptdependenciesjavasoftware installation

As you can see in the screenshot, i was told to apt-get install oracle-java8-install but it gave me an error that I don't have met dependencies of java-common. Okay, great. Now I try to install apt-get install java-common. Another error! Now I'm totally lost.

Ubuntu is at version 18.04, after so many years why is it still such a PITA to install simple stuff like this.

I am going to cry.

enter image description here

Best Answer

Why is it such a PITA? The Oracle version of Java is not able to be distributed the same way as other Ubuntu packages. The best solution to this is to use the openJDK version of Java.

If you absolutely need to use Oracle Java 8, you'll need to add a PPA to your repository list:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt update

And then install Oracle Java 8 (I'm assuming you also want it to be set as default)

$ sudo apt install oracle-java8-set-default

This should begin the installation, and you should get a prompt asking to accept the license. Use the keyboard to accept it, and it should begin downloading Oracle Java 8. You should see a progress indicator that scrolls up your screen.

It should install Oracle Java 8 update 181.