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
Partially derived from https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/generic-linux-install.html
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
- https://aws.amazon.com/corretto
- https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/generic-linux-install.html
- https://linuxize.com/post/how-to-add-apt-repository-in-ubuntu/
Revision History
Created 2023 06
Comments
Post a Comment