Skip to content

Guide to Installing Java 8 on Debian - Step by Step

Tutorials & Guides  ·   ·   ·  Updated on  ·  2 min Reading time

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.

Frequently asked questions

Why would I install Java 8 if it has reached end of life?
Sometimes older software or applications require Java 8 specifically, leaving you no choice but to use it despite its EOL status.
What are the risks of using EOL software like Java 8?
EOL software no longer receives updates or security patches, so known vulnerabilities remain unfixed. Use the latest supported version whenever possible.
Which repository provides Java 8 packages for Debian?
The AdoptOpenJDK APT repository provides the adoptopenjdk-8-hotspot package used in this guide.
Prepaid-Host.com is itself a provider of servers, web hosting and domains, and reports here on its own market. How we handle that is set out in our disclosure statement.