How To Install OpenJdk-8 Manually On Your Linux Machine?

How To Install OpenJdk-8 Manually On Your Linux Machine? How do I manually install Java on Linux? How do I manually install jdk?
Install Java 8 manually

As Java 8 is not installed by default on newer Kali Linux versions, this guide will show you how to manually install JDK 8 without any errors. This is essential to running some of the apps, because they typically require Java 8 to work and will not run on Java 11. The JDK also allows you to develop in Java, but if you don't care about that, you can install the JRE the same way.

Follow The Below Steps:
Step 1: JDK8 can be downloaded from the Oracle website.
Step 2: Go to the jvm Directory.
Use this command: cd /usr/lib/jvm
Step 3: Unzip the JDK8 file.
Use the command: sudo tar -xvzf ~/Downloads/jdk-8u321-linux-x64.tar.gz
Step 4: Now Edit The Environment Variable.
Use the command: sudo nano /etc/environment

Step 5: Add the Following Variables:

:/usr/lib/jvm/jdk1.8.0_321/bin:/usr/lib/jvm/jdk1.8.0_321/db/bin:/usr/lib/jvm/jdk1.8.0_321/jre/bin
J2SDKDIR="/usr/lib/jvm/jdk1.8.0_321"
J2REDIR="/usr/lib/jvm/jdk1.8.0_321/jre"
JAVA_HOME="/usr/lib/jvm/jdk1.8.0_321"
DERBY_HOME="/usr/lib/jvm/jdk1.8.0_321/db"

Step 6: Update the JDK Files.

Use the following commands:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_321/bin/java" 0
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_321/bin/javac" 0
sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_321/bin/java
sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_321/bin/javac
Step 7: Now it's time to update the alternative lists.
Use the following commands:
sudo update-alternatives --list java
sudo update-alternatives --list javac
sudo update-alternatives --config java

Now select option 2 and press Enter.

Now check the java version by simply just giving the command:
 java -version

If you have followed all the above given steps correctly, then Java 8 (openjdk-8-jdk) has been successfully installed on your system.

Post a Comment

DO NOT TRY TO SPAM!
© CodeSec. All rights reserved. Distributed by TechXploitz