• Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install Java 8 on Debian 10/9/8 via PPA

Written by Rahul, Updated on May 2, 2019

How do I Install Java 8 on Debian?. The first Oracle Java 8 stable version was released on Mar 18, 2014, and available to download and install. Oracle Java PPA for Debian systems is being maintained by Webupd8 Team. JAVA 8 is released with many of new features and security updates. This tutorial will help you to Install Java 8 on Debian 9/8/7 systems using PPA and apt-get command.

The Ubuntu and LinuxMint users use below link to install Java 8 on their system.

IMPORTANT: Java 8 is no longer available to download publically. You can use below link to install Java 11.

  • Read this => Install Java 11 on Debian 9 (Stretch)
  • Read this => Install Java 11 on Debian 10 (Buster)

Step 1 – Add Java 8 PPA

The webupd8 team has built a Java installer package for Debian systems. You need to add that PPA repository to your system for installing Java 8 on Debian.

Create a new Apt configuration file /etc/apt/sources.list.d/java-8-debian.list, and edit in text editor.

sudo vim /etc/apt/sources.list.d/java-8-debian.list

and add following content in it.

deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main

Now import GPG key on your system for validating packages before installing them.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886

Step 2 – Install Java 8 on Debian

You are all set to start Java installation on Debian. Run the following commands to update apt-cache and then install Java 8 on Debian system using the apt-get package manager.

sudo apt-get update
sudo apt-get install oracle-java8-installer

The installer will prompt for accept Oracle terms in order to continue Java installation on Debian. Accept the terms and complete setup.

Step 3 – Verify Java Installation

Finally, you have successfully installed Oracle Java on your Debian system. Let’s use the following command to verify installed version of Java on your system.

java -version

java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

Step 4 – Setup Java Environment

The Webupd8 PPA repository also provides a package to set environment variables, Install this package using the following command.

sudo apt-get install oracle-java8-set-default

References:
https://launchpad.net/~webupd8team/+archive/java

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

27 Comments

  1. Avatar anyBody Reply
    January 14, 2021 at 8:27 pm

    Don’t work….

  2. Avatar Ben Reply
    May 5, 2020 at 5:57 pm

    umm…

    W: GPG error: http://ppa.launchpad.net/webupd8team/java/ubuntu trusty InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY C2518248EEA14886
    E: The repository ‘http://ppa.launchpad.net/webupd8team/java/ubuntu trusty InRelease’ is not signed.
    N: Updating from such a repository can’t be done securely, and is therefore disabled by default.

    I did exactly as you said and looks like it isn’t much use?…

  3. Avatar Leutech Reply
    October 22, 2019 at 11:41 am

    For all other guys wo see this. If you have debian 8/9/10. On Debian 8 and 9 you can run “apt install openjdk-8-jdk” and for Debian 10 (Buster), if you want the java 8 version add this in the sources.list file in /etc/apt:

    deb “http://ftp.debian.org/debian” stretch main
    deb-src ” http://ftp.de.debian.org/debian” stretch main

    after you add these 2 lines in the sources.list file you have to update with “apt update” and after that you can run “apt install openjdk-8-jdk”. After the installation of java i recommended to delete the 2 lines from the source.list file and update again and now all would be fine

    • Avatar amanwithnoplan Reply
      May 6, 2020 at 3:45 am

      THANK YOU, I was working at this for like 5 HOURS, it took me so long to realize it was Debian 10 and not 9 but if I didn’t see this I would’ve given up THANK YOU!

  4. Avatar dima Reply
    October 20, 2019 at 7:51 pm

    wow!

  5. Avatar sandeep Reply
    April 29, 2019 at 5:24 am

    seems launchpad has removed the orcale java 8

    https://launchpad.net/~webupd8team/+archive/ubuntu/java

    How can I install the orcale java 8 on debian? any ideas is there any other repositories?

  6. Avatar Tom Reply
    April 2, 2019 at 4:49 pm

    Under my current OS release, the command to update the key store is

    sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys EEA14886

  7. Avatar Jose Reply
    October 22, 2018 at 2:35 am

    Thanks eclipse Neon.3 start to run again!

  8. Avatar Slappy Reply
    July 16, 2018 at 12:24 am

    I am running Raspian Stretch Lite and when I attempt to hit the import of the key it fails with:

    “[email protected]:~ $ sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys EEA14886
    Executing: /tmp/apt-key-gpghome.l6hy3eHIwG/gpg.1.sh –keyserver keyserver.ubuntu.com –recv-keys EEA14886
    gpg: failed to start the dirmngr ‘/usr/bin/dirmngr’: No such file or directory
    gpg: connecting dirmngr at ‘/tmp/apt-key-gpghome.l6hy3eHIwG/S.dirmngr’ failed: No such file or directory
    gpg: keyserver receive failed: No dirmngr”

    I also tried instead doing the Java 9 and it fails at the key import as well. What am I doing wrong?

    • Rahul Rahul K. Reply
      July 17, 2018 at 4:28 am

      Please install before this:

      sudo apt-get install dirmngr

  9. Avatar Dingus Reply
    May 8, 2018 at 1:13 pm

    Thanks for this, it helped me out

  10. Avatar yusuf nasoro Reply
    January 3, 2018 at 3:11 pm

    how can I proceed by adding the following content to it?
    deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
    deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main

    cause it stucks there

  11. Avatar protorp Reply
    August 3, 2017 at 10:41 pm

    Realy thanx) It need me to run DBeaver 4.

  12. Avatar agalgo Reply
    June 14, 2017 at 1:13 am

    So far so good. Thanks.

  13. Avatar cesar Reply
    May 31, 2017 at 2:36 am

    Excelent!! Thank

  14. Avatar Premalatha Reply
    April 11, 2017 at 6:54 am

    Good!!!., Simple and clean

  15. Avatar yuri Reply
    February 27, 2017 at 9:53 pm

    not work can you help me?
    [email protected]:/usr/bin# sudo apt-get install oracle-java8-installer
    Lettura elenco dei pacchetti… Fatto
    Generazione albero delle dipendenze
    Lettura informazioni sullo stato… Fatto
    oracle-java8-installer è già alla versione più recente.
    0 aggiornati, 0 installati, 0 da rimuovere e 0 non aggiornati.
    3 non completamente installati o rimossi.
    Dopo quest’operazione, verranno occupati 0 B di spazio su disco.
    Continuare? [S/n] s
    Configurazione di java-common (0.52)…
    mkdir: impossibile creare la directory “/etc/.java/.systemPrefs”: File già esistente
    dpkg: errore nell’elaborare il pacchetto java-common (–configure):
    il sottoprocesso installato script di post-installation ha restituito lo stato di errore 1
    dpkg: problemi con le dipendenze impediscono la configurazione di oracle-java8-installer:
    oracle-java8-installer dipende da java-common (>= 0.24); comunque:
    Il pacchetto java-common non è ancora configurato.

    dpkg: errore nell’elaborare il pacchetto oracle-java8-installer (–configure):
    problemi con le dipendenze – lasciato non configurato
    Configurazione di jdk1.8.0-121 (1.8.0121-1)…
    Error: unpack200 – command could not be found.

    Please refer to the Troubleshooting section of theInstallation Instructions
    on the download page.
    find: “/usr/java/*”: File o directory non esistente
    update-alternatives: errore: il percorso alternativo /usr/java/jdk1.8.0_121/jre/bin/java non esiste
    update-alternatives: errore: il percorso alternativo /usr/java/jdk1.8.0_121/bin/javac non esiste
    dpkg: errore nell’elaborare il pacchetto jdk1.8.0-121 (–configure):
    il sottoprocesso installato script di post-installation ha restituito lo stato di errore 2
    Si sono verificati degli errori nell’elaborazione:
    java-common
    oracle-java8-installer
    jdk1.8.0-121
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    • Avatar Harish Sharma Reply
      March 19, 2017 at 11:47 am

      Thanks for the article. Saved me some time.

  16. Avatar Kamal Reply
    February 22, 2017 at 12:26 pm

    thanks from germany

  17. Avatar Artem Reply
    February 6, 2017 at 6:07 pm

    Thanks a lot! You save my time!

  18. Avatar cristianzamar Reply
    September 2, 2016 at 4:53 pm

    Thank you very much!! Every step worked perfectly.. I used nano instead of vim.

  19. Avatar Ryan Cooper Reply
    July 18, 2016 at 8:58 pm

    And I just want to use it to play minecraft… so thank you very much!

  20. Avatar Grayson Reply
    June 6, 2016 at 6:11 pm

    Thank you very much for this clear explanation. This was very helpful.

  21. Avatar gabriel Reply
    May 6, 2016 at 1:03 pm

    thank you, install went smooth on Debian 7.8

  22. Avatar Anand Raj Reply
    April 6, 2016 at 4:40 pm

    Thanks you so much…

  23. Avatar Eli663 Reply
    April 4, 2016 at 3:21 am

    Instead of vim you could use gedit if you computer does not have vim command.

    • Avatar Sudhanshu Kumar Reply
      May 24, 2018 at 6:09 am

      apt-get install vim
      You could be able to get VIM

      Else you can use vi editor.

Leave a Reply Cancel reply

Popular Posts

  • How to View or List Cron Jobs in Linux
  • How to Install PHP 8 on Ubuntu 20.04
  • How to Set Up SSH Tunnel with PuTTY
  • How to Install Tor Browser on Ubuntu 20.04
  • Issue with phpMyAdmin and PHP: Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”
  • How to Allow Remote Connections to MySQL
  • How to Install MySQL 8.0 on Ubuntu 20.04
  • How to Install Apache Kafka on Ubuntu 20.04
© 2013-2021 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy