Installing Oracle JDK 8 on Debian 9

I have always installed Oracle JDK 8 on Debian 8 with the following instructions with no problem

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer

      

But on Debian 9, when I execute the following command

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

      

I am getting the following errors:

root@debian:/etc/apt/sources.list.d# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
Executing: /tmp/apt-key-gpghome.OEi3EFigqe/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --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.OEi3EFigqe/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr

      

How do I install Oracle JDK 8 on Debian 9?

+3


source to share


3 answers


It seems that dirmngr is not installed: gpg: failed to start dirmngr '/ usr / bin / dirmngr': No such file or directory. You can try installing it with apt-get install dirmngr and try again.



+2


source


I was able to fix the following commands:



  • apt remove gnupg
  • apt install - install gnupg2 (maybe not needed, but won't hurt)
  • apt install dirmngr
+3


source


You can install it manually if you like download JDK8

wget --no-cookies --no-check-certificate --header "Cookie:oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz

      

do it in your OS environment variables:

JAVA_HOME= ~/path_Of_Your_JDK_DIR
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export PATH

      

I hope you help Arya.

+2


source







All Articles