Guys I need to install jdk 8 for my programs to work better, many programs do not support the version higher than Java 8 so I want to install Java 8 to run better, I tried to install via apt-get, but I saw that it was removed from the Kali repository because very old. Can anyone help me how to install? When I run the command uname -m it shows me that the architecture is aarch64 can someone tell me how to install Java 8 on Nethunter for aarch64? Thanks in advance :)

  • what does run better mean? ... what problem are you trying to solve? – jsotola Feb 26 at 3:02
  • I'm trying to download Java 8 so my programs can run better. – Dakota Feb 26 at 3:17
  • It should be available in the repos. What does apt search openjdk-8 return? – ajgringo619 Feb 26 at 3:26
  • @ajgringo619 Sorting... Done Full Text Search... Done libreoffice/kali-rolling,unknown 1:7.0.4-3 arm64 office productivity suite (metapackage) nvidia-openjdk-8-jre/kali-rolling,unknown 9.+8u272-b10-0+deb9u1~11.2.0-2 amd64 Obsolete OpenJDK Java runtime, for NVIDIA applications – Dakota Feb 26 at 3:27

Download JDK from the official website (subscription is required) or use the following command:

wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn/java/jdk/8u281-b09/89d678f2be164786b292527658ca1605/jdk-8u281-linux-x64.tar.gz?AuthParam=1614342179_659c3e77bffb9a532e2e87404c0c6647

then install it:

sudo mkdir /usr/lib/jvm
mv 'jdk-8u281-linux-x64.tar.gz?AuthParam=1614342179_659c3e77bffb9a532e2e87404c0c6647' jdk-8u281-linux-x64.tar.gz
sudo tar xvf jdk-8u281-linux-x64.tar.gz -C /usr/lib/jvm

Add java and javac to update-alternatives:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_281/bin/java" 100
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_281/bin/javac" 100

set jdk1.8 as default:

sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_281/bin/java

Check it:

java -version

sample output:

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

Guys I managed to solve by adding this line to my sources.list:

deb http://security.debian.org/debian-security stretch/updates main and then I ran this command:


And then this:

apt install openjdk-8-jdk

And finally this:

sudo update-alternatives --config java

Then just choose Java 8 and that's it, Java is running :)

  • Adding Debian without a pin priority is discouraged. – GAD3R Feb 26 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.