Install openjdk 8 jdk kali linux

How to download and install prebuilt OpenJDK packages

Oracle’s OpenJDK JDK binaries for Windows, macOS, and Linux are available on release-specific pages of jdk.java.net as .tar.gz or .zip archives.

As an example, the archives for JDK 13 may be found on jdk.java.net/13 and may be extracted on the command line using

depending on the archive type.

JDK 8

Debian, Ubuntu, etc.

The openjdk-8-jre package contains just the Java Runtime Environment. If you want to develop Java programs then please install the openjdk-8-jdk package.

Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.

The java-1.8.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.8.0-openjdk-devel package.

JDK 7

Debian, Ubuntu, etc.

The openjdk-7-jre package contains just the Java Runtime Environment. If you want to develop Java programs then install the openjdk-7-jdk package.

Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.

The java-1.7.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.7.0-openjdk-devel package.

JDK 6

Debian, Ubuntu, etc.

The openjdk-6-jre package contains just the Java Runtime Environment. If you want to develop Java programs then install the openjdk-6-jdk package.

Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.

The java-1.6.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.6.0-openjdk-devel package.

BSD Port

For a list of pointers to packages of the BSD Port for DragonFly BSD, FreeBSD, Mac OS X, NetBSD and OpenBSD, please see the BSD porting Project’s wiki page.

Источник

How to Install Java OpenJDK8 on Kali Linux Manually

There are lots of cybersecurity projects and tools are available on the internet. Some of them like L3mon , HaxRAT and other Android RAT tools requires Java 8/OpenJDK version 8 on our system. In Kali Linux recent update OpenJDK 8 is removed from Kali Linux repository and only OpenJDK 11 comes with Kali Linux. But some tools written on Java 8 so of we want to use those tools we must need to install OpenJDK 8 on our Kali Linux manually.

Читайте также:  Virtualbox linux графический режим

In our this article we are going to learn how to install OpenJDK 8 on our Kali Linux system.

Installing OpenJDK 8 on Kali Linux

In our this article we are going to install OpenJDK 8 on our favorite Kali Linux system. Before that we are going to check our system which version if Java is installed on our system by applying following command on our terminal:

We can see the output on the following screenshot:

In the above screenshot we can clearly see that we have only OpenJDK 11 on our system. Let’s start the OpenJDK 8 installation process start. First of all we need to go into Oracle Official website and Create an Oracle account and login there.

Oracle Account creation page

After sign up and login we need to move to the download page of OpenJDK 8 . We need to scroll down a little bit to find OpenJDK version 8, as shown in the following screenshot:

For our x64 PC we are downloading the highlighted version

We click on the jdk-8u321-linux-x64.tar.gz link to download. Then we got a popup window and we accept the terms and conditions of Oracle to download this. Shown in the following screenshot:

Now we need to click on the download button and let the download finish. Usually the downloads files stored on our Downloads directory. Now lets open our terminal and navigate to /usr/lib/jvm (If our system doesn’t have any of Java versions then we need to create this jvm directory under /usr/lib manually by using sudo mkdir -p /usr/lib/jvm command) by using following command:

Now here we are going to extract our Java OpenJDK 8 compressed file by using following command:

sudo tar -xvzf ~/Downloads/jdk-8u321-linux-x64.tar.gz

We can see the output on the following screenshot:

After all files extracted we need to navigate to our newly de-compressed directory (jdk1.8.0_321) by using following command:

Here we need to set the java path to do so we need to change the environmental variables. We need to edit the file by text editor like Nano, so we run the following command to edit the file:

We can see the output of the above command in the following screenshot:

Читайте также:  Linux создать ссылку на исполняемый файл

In the above screenshot we can clearly see that there are some paths are already set. Two paths are divided by : symbol. Here we need to add some paths so we added a : sign after /usr/games path and add some paths that is /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

After adding these paths our files looks like following screenshot:

In the above screenshot we had highlighted the modified part of default file. Now we save and close this file by using CTRL+X then Y then Enter ⤶ key.

Now we will install OpenJDK 8 as an alternative, so that we can change our Java versions easily as per our requirement. We need to use following command:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_321/bin/java" 0

After that we will set Java compiler by using following command:

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

Now we can set Java OpenJDK 8 by using following command:

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

Also for the Java compiler we use following command:

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

Output of these previous commands shown in the following screenshot:

Now we are ready to rock. Let choose our Java version by using following command from anywhere of our terminal:

sudo update-alternatives --config java

The output of the above command shown in the following screenshot:

In the above screenshot we can clearly see that our Java version 8 is on the number 2, and the Java version 11 is on number 0. So we just need to run the above command to switch between Java versions. Here we are going to use Java OpenJDK8, so here we need to type 2 and hint ENTER ⤶ button. As we can see in the following screenshot:

Now we are using Java 8, as we can see the output of java -version command in the following screenshot:

In the above screenshot we can see that now Java version 8 (In JDK 8 and JRE 8, the version strings are 1.8 and 1.8) is default on our system. Now we can use any tool using Java8 on our system easily. This is how we can install Java 8 on Linux (especially on Kali Linux) manually.

Love our articles? Make sure to follow us on Twitter and GitHub , we post article updates there. To join our KaliLinuxIn family, join our Telegram Group . We are trying to build a community for Linux and Cybersecurity. For anything we always happy to help everyone on the comment section . As we know our comment section is always open to everyone. We read each and every comment and we always reply .

Читайте также:  What is linux unix system administration

Источник

Установка java 1.8.0 на Kali Linux virtualbox

Говорю сразу. нужна именно эта версия. Задаю вопрос, после нескольких блужданий в интернете. Перепробовал все. Замену с помощью Waw, удалением и прочим. Знатоки, помогите подробным советом. Заранее спасибо.

Пожалуйста, исправьте вопрос, чтобы он отражал конкретную проблему с достаточным количеством деталей для возможности дать адекватный ответ.

1 ответ 1

Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true openjdk 11.0.12 2021-07-20 OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2) OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing) 
sudo apt-get install openjdk-8-jdk 
Reading package lists. Done Building dependency tree. Done Reading state information. Done E: Unable to locate package openjdk-8-jdk 

Переходим на сайт https://jdk.java.net/java-se-ri/8-MR3 и качаем Oracle Linux 7.6 x64 Java Development Kit (md5) 167 MB. Распаковываем в /usr/lib/jvm/ и переименовываем папку в java-8 .

update-alternatives --list java 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 

Поочередно в терминал вводим команды:

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-8/bin/java 1 sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-8/bin/javac 1 sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java-8/bin/jar 1 sudo update-alternatives --install /usr/bin/jshell jshell /usr/lib/jvm/java-8/bin/jshell 1 
update-alternatives: error: alternative path /usr/lib/jvm/java-8/bin/jshell doesn't exist 
update-alternatives --display java 
java - auto mode link best version is /usr/lib/jvm/java-11-openjdk-amd64/bin/java link currently points to /usr/lib/jvm/java-11-openjdk-amd64/bin/java link java is /usr/bin/java slave java.1.gz is /usr/share/man/man1/java.1.gz /usr/lib/jvm/java-11-openjdk-amd64/bin/java - priority 1111 slave java.1.gz: /usr/lib/jvm/java-11-openjdk-amd64/man/man1/java.1.gz /usr/lib/jvm/java-8/bin/java - priority 1 
sudo update-alternatives --config java 
There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode 1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode 2 /usr/lib/jvm/java-8/bin/java 1 manual mode Press to keep the current choice[*], or type selection number: 

Вводим цифру 2 и нажимаем Enter

update-alternatives: using /usr/lib/jvm/java-8/bin/java to provide /usr/bin/java (java) in manual mode 

Командой sudo update-alternatives —config java проверяем, что теперь выбрана нужная версия java :

There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode 1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode * 2 /usr/lib/jvm/java-8/bin/java 1 manual mode Press to keep the current choice[*], or type selection number: 

Нажимаем Ctrl + C и выходим.

Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true openjdk version "1.8.0_41" OpenJDK Runtime Environment (build 1.8.0_41-b04) OpenJDK 64-Bit Server VM (build 25.40-b25, mixed mode) 

Необходимая версия установлена.

Источник

Оцените статью
Adblock
detector