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

10,211

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.

Share:
10,211

Related videos on Youtube

Patoshi パトシ
Author by

Patoshi パトシ

Updated on September 18, 2022

Comments

  • Patoshi パトシ
    Patoshi パトシ over 1 year

    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

    • aasril
      aasril over 5 years
      It looks like you're following an obsolete tutorial. Does it have to oracle jdk? Ubuntu has openjdk packages in the repository. For jdk 8 the package name is openjdk-8-jdk. Btw, openjdk is the reference implementation of java. Also there is default-jdk meta-package but I'm not sure what version of jdk it will pull, in 16.04 it's jdk 8.
    • Patoshi パトシ
      Patoshi パトシ over 5 years
      I tried sudo apt install openjdk-8-jdk i get dependency error: oracle-java8-installer : Depends: java-common but it is not installable -- I then do a apt install java-common which throws error: Unable to locate package oracle-java-common
    • aasril
      aasril over 5 years
      You need to fix/remove the broken package first. This is entirely a different problem. You can search the solution on this website or google.
  • Patoshi パトシ
    Patoshi パトシ over 5 years
    Doesn't work! I get hit with dependency errors again: says to install oracle-java8-installer and then that fails and ask for oracle-java-common which also fails too! "unable to locate package oracle-java-common'
  • Tobbey
    Tobbey about 5 years
    Does not work. since this ppa was disabled
  • emptythevoid
    emptythevoid almost 5 years
    I think the PPA is still around, but it may only support up to Ubuntu 18.10. launchpad.net/~webupd8team/+archive/ubuntu/java