Today I want to show you how to install Java 8 on your Debian server, even though it has officially reached end of life (EOL).
Be aware that using EOL software carries risks, since no further updates or security patches will be provided. That's why we always recommend using the latest version of any software whenever possible.
But sometimes we have no other choice, and we need to use older software versions for whatever reason. Don't worry, I'm here to help! So let's get started.
First, you need to log in to your server via SSH using, for example, Putty.
1. Update the server
To do this, enter the following command:
root@testserver ~ # apt update
2. Install required packages
We need to make sure we have wget and lsb-release on our system. Run the following command to install them:
root@testserver ~ # apt install wget lsb-release -y
3. Download and add the public key for the repository
Now we download the public key for the AdoptOpenJDK APT repository and add it:
root@testserver ~ # wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
4. Add the repository
In the next step, we add the AdoptOpenJDK repository to our Debian installation:
root@testserver ~ # echo "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/adoptopenjdk.list
5. Update the server
We update our server again to apply the changes:
root@testserver ~ # apt update
6. Install Java 8
Now we're ready to install Java 8. To do this, enter the following command:
root@testserver ~ # apt install adoptopenjdk-8-hotspot -y
7. Check the Java version
After installation, we can check whether Java 8 was installed successfully. To do this, enter the following command:
root@testserver ~ # java -version
If everything went well, you should now see that you have Java 8 installed.
I hope this guide was helpful.