Use Amazon Coretto for OpenJDK Java 8 for Debian Linux like Kali - other version too

Linux package repositories often only hold the latest LTS versions.  You have to look elsewhere if you need something like Java 8.  Look to Amazon Coretto if you want specific versions of Java installed on your Linux instance. 

Amazon maintains Corretto distributions going back to Java 8 when checked at 2023 06. Debian, Ubuntu, Kali, etc. Users can add the Corretto repository to their instances and then install specific OpenJDK versions using standard apt.

Installation

The Corretto install instructions assume you have add-apt-repository installed.  So install add-apt-repository

sudo apt update
sudo apt install software-properties-common

Add the Corretto repository

wget -O- https://apt.corretto.aws/corretto.key | sudo apt-key add -
sudo add-apt-repository 'deb https://apt.corretto.aws stable main'

Install Java 8 Corretto

sudo apt-get update; sudo apt-get install -y java-1.8.0-amazon-corretto-jdk

Check the versions Java that are installed on this machine.  You can see the current default with

java --version

Debian supports the installation of multiple versions of java. You can set the current default Java JRE and JDK versions with

sudo update-alternatives --config java
sudo update-alternatives --config javac


References

Created 2023 06

Comments

Popular posts from this blog

Understanding your WSL2 RAM and swap - Changing the default 50%-25%

Installing the RNDIS driver on Windows 11 to use USB Raspberry Pi as network attached

DNS for Azure Point to Site (P2S) VPN - getting the internal IPs