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.
- 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
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?…
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
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!
seems launchpad has removed the orcale java 8
How can I install the orcale java 8 on debian? any ideas is there any other repositories?
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
Thanks eclipse Neon.3 start to run again!
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?
Please install before this:
sudo apt-get install dirmngr
Thanks for this, it helped me out
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
Realy thanx) It need me to run DBeaver 4.
So far so good. Thanks.
Good!!!., Simple and clean
not work can you help me?
r[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:
E: Sub-process /usr/bin/dpkg returned an error code (1)
Thanks for the article. Saved me some time.
thanks from germany
Thanks a lot! You save my time!
Thank you very much!! Every step worked perfectly.. I used nano instead of vim.
And I just want to use it to play minecraft… so thank you very much!
Thank you very much for this clear explanation. This was very helpful.
thank you, install went smooth on Debian 7.8
Thanks you so much…
Instead of vim you could use gedit if you computer does not have vim command.
apt-get install vim
You could be able to get VIM
Else you can use vi editor.