10

Is there a way to install Oracle Java 8 on Ubuntu 19.04?

The webupd8team/java ppa is empty at the time writing.

3

2 Answers 2

13

I just upgraded to Ubuntu 19.04 on Sunday and had this exact same problem the webupd8team PPA was removed due to the recent Oracle license changes.

I solved the problem using this script from GitHub: install-java.sh

It is a Bash script that did a professional install of Oracle JDK 1.8_201 using the files I downloaded from Oracle's website. I have just used it today and selected yes to everything. It works like a charm on Ubuntu 19.04. I ran with with the following files that I downloaded from Oracle:

-rwxrwxrwx 1 don don      8409 Sep 26  2018 jce_policy-8.zip
-rwxrwxrwx 1 don don  58807261 Jan 21 22:56 jdk-8u201-linux-x64-demos.tar.gz
-rwxrwxrwx 1 don don 191817140 Jan 21 22:50 jdk-8u201-linux-x64.tar.gz

It installs JDK into /usr/lib/jvm and adds the programs (java, javac, etc.) to /usr/bin, and will update or add JAVA_HOME to your bashrc file.

I tested the installation by running a GUI Java program from my desktop. Everything is working perfectly.

9
  • I would like to add that some files and folders ended up with another owner and or group id so I fixed that with $ sudo chown -R root:root /usr/lib/jvm/jdk1.8.0_201/
    – Don
    Apr 24, 2019 at 23:16
  • exactly what I needed, works like a charm, thanks!
    – RaptoX
    May 27, 2019 at 13:43
  • 1
    install_java.sh: 24: install_java.sh: Syntax error: "(" unexpected Jul 21, 2019 at 3:09
  • It works fine for me with Oracle JDK 8u221, in fact the author recently updated the script on GitHub and added some improvements. I recommend posting the full details of your error as a separate question and include the script link and the distribution file you are trying to install, and the command line syntax you used. Your error appears to be a unique issue/question.
    – Don
    Jul 21, 2019 at 17:53
  • 1
    @cellsuicide, Yes I resolved it by installing Open JDK version 8. Here is the link openjdk.java.net/install .. $ sudo apt-get install openjdk-8-jdk . OpenJDK is completely open source and can be used it freely. Jul 24, 2019 at 11:16
0

Did you try installing headless jdk? as following?

sudo dpkg --configure -a
sudo apt-get install openjdk-8-jdk-headless -y --force-yes
1
  • 2
    OP was asking for Oracle Java 8
    – zalpha314
    May 31, 2019 at 2:18

Not the answer you're looking for? Browse other questions tagged .