Usually you install the openjdk like this:

sudo apt-get install openjdk-8-jdk

Maybe this is the problem. You can look this up at http://openjdk.java.net/install/index.html. If you do this you might have fixed this problem. But cant imagine why your command give this result.

Answer from Booming on askubuntu.com
🌐
Oracle
java.com › en › download › help › linux_x64_install.html
Linux 64-bit installation instructions for Java
The instructions below are for installing version Java 8 Update 73 (8u73). If you are installing another version, make sure you change the version number appropriately when you type the commands at the terminal. Example: For Java 8u79 replace 8u73 with 8u79.
Discussions

java - How to install jdk 8 on ubuntu server 18.04? - Stack Overflow
I am trying to install JDK 8 ON Ubuntu server 18.04 LTS, with the following commands: sudo apt install openjdk-8-jre sudo apt install openjdk-8-jdk /usr/lib/jvm folder has: I also set the path in... More on stackoverflow.com
🌐 stackoverflow.com
how do i get java 8 on bookworm Ubuntu i have been trying for 3 hours
you mean this? openjdk-8-jdk/noble-updates,noble-security 8u442-b06~us1-0ubuntu1~24.04 amd64 OpenJDK Development Kit (JDK) sudo apt install openjdk-8-jdk Found with.. apt search ^openjdk-8 More on reddit.com
🌐 r/linux4noobs
4
0
March 26, 2025
Install Java 8 Ubuntu

You need to edit your path variable to point Java at the java8 jdk bin.

Try following this, it seems very easy and I'm pretty sure it isn't Azul specific.

https://docs.azul.com/zulu/zuludocs/ZuluUserGuide/SwitchingBetweenJavaAlternatives/SwitchBetweenYourLinuxZuluInstallations.htm

More on reddit.com
🌐 r/javahelp
12
1
March 24, 2021
How do I install Java 8 JRE
I'd suggest you run sudo apt update; sudo apt list | grep jre to find the package name. I do remember that the JRE and JDK package names are often confusing, so that's why I'm recommending this approach. More on reddit.com
🌐 r/linux4noobs
8
2
May 30, 2023
🌐
Ubuntu
ubuntu.com › tutorials › install-jre
Install the Java Runtime Environment | Ubuntu
In the next step we’ll install Oracle HotSpot JRE. Download JRE binaries in .tar.gz (tarball) by heading over to their website. An Oracle account is needed to download the Oracle HotSpot JRE. Oracle does not currently offer JRE packages for Java 11 or above from their website so, for this tutorial, we will use the Oracle HotSpot JRE version to be 8u291 (Java 8, update 291).
🌐
Stack Overflow
stackoverflow.com › questions › 71017113 › how-to-install-jdk-8-on-ubuntu-server-18-04
java - How to install jdk 8 on ubuntu server 18.04? - Stack Overflow
Command 'java' not found, but can be installed with: sudo apt install default-jre sudo apt install openjdk-11-jre-headless sudo apt install openjdk-8-jre-headless
🌐
Contabo
contabo.com › home › how to install java on ubuntu 18.04, 20.04 & 22.04 using apt-get
How To Install Java on Ubuntu 18.04, 20.04 & 22.04 using Apt-Get
August 11, 2023 - In this comprehensive step-by-step guide you will learn how to install different versions of Java on your Ubuntu server using Apt-Get.
🌐
OpenJDK
openjdk.org › install
OpenJDK: Download and install
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.
Find elsewhere
🌐
Liquid Web
liquidweb.com › home › how to install oracle java 8 on ubuntu 22.04
How To Install Oracle Java 8 on Ubuntu 22.04 | Liquid Web
December 2, 2024 - ... Open a terminal and log in as root. If you are logged in as another user, you will need to add sudo before each command. We will be working on a Liquid Web Core-Managed Linux Ubuntu 16.04 LTS server
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › How-do-I-install-Java-on-Ubuntu
How to install Java 21 on Ubuntu
8 Linux Distributions to Replace CentOS –TechTarget · While Ubuntu does not come with Java’s JDK preinstalled, it does come prepackaged with the ability to easily install Java with the apt command. To quickly install Java on Ubuntu and have the JDK’s utilities included on the operating system’s PATH, follow these five steps: First verify that Java is not already inststalled ·
🌐
Oracle
java.com › en › download › help › linux_x64rpm_install.html
Linux 64-bit RPM Java installation instructions
The instructions below are for installing version Java 8 Update 73 (8u73). If you are installing another version, make sure you change the version number appropriately when you type the commands at the terminal. Example: For Java 8u79 replace 8u73 with 8u79.
🌐
Linux Today
linuxtoday.com › home › news
How to install Java (JDK and JRE) on Ubuntu 20.04 LTS | Linux Today
June 22, 2021 - Java is the most widely used programming language. It can be used to create server and desktop applications and Java runs on almost all operating systems like Mac OS, Windows, and Linux. This article will show the installation of Java 8 and Java 11 JDK and JRE on Ubuntu 20.04 using the terminal and how […]
🌐
Baeldung
baeldung.com › home › devops › installing java on ubuntu
Installing Java on Ubuntu | Baeldung
January 8, 2024 - Let’s install OpenJDK 8 from the “Main” repository with apt: $ sudo apt update $ sudo apt install openjdk-8-jdk ... openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.18.04.1-b13) OpenJDK 64-Bit ...
🌐
Reddit
reddit.com › r/javahelp › install java 8 ubuntu
r/javahelp on Reddit: Install Java 8 Ubuntu
March 24, 2021 -

I am trying to install Java 8 for Linux. After I performed

sudo apt-get install openjdk-8-jdk

and verify with java -version I still got OpenJDK 15.0.1.

How do I switch to Java 8?

Top answer
1 of 2
2

You need to edit your path variable to point Java at the java8 jdk bin.

Try following this, it seems very easy and I'm pretty sure it isn't Azul specific.

https://docs.azul.com/zulu/zuludocs/ZuluUserGuide/SwitchingBetweenJavaAlternatives/SwitchBetweenYourLinuxZuluInstallations.htm

2 of 2
1

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions

  • You include any and all error messages in full

  • You ask clear questions

  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://imgur.com/a/fgoFFis) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

🌐
Azul Systems
azul.com › home › azul downloads
Java 8, 11, 17, 21, 25 Download for Linux, Windows and macOS
January 30, 2023 - Click here to download the Azul Zulu Builds of OpenJDK for Java 8, 11, 17, 21, 25 for Linux, Windows and macOS. Also download Azul Platform Prime.
🌐
Adoptium
adoptium.net › temurin › releases
Latest Releases | Adoptium
All VersionsJDK 25 - LTSJDK 21 - LTSJDK 17 - LTSJDK 11 - LTSJDK 8 - LTS · No releases match your current filter criteria. Try adjusting your selections or reset all filters to see available releases. There are multiple different ways to get Eclipse Temurin beyond direct downloads. The curated list below shows some of these options for installing high-performance, cross-platform, open-source OpenJDK runtime binaries.
🌐
Medium
ktsravindu.medium.com › installing-java-8-and-11-on-the-same-ubuntu-20-04-4d5aaf10a3a4
Installing Java 8 and Java 11 on the same Ubuntu 20.04 | by Shehan Ravindu | Medium
January 4, 2022 - We can use the JAVA_HOME variable to define the Java installation location. You can follow the below-mentioned steps to set the JAVA_HOME variable. Run sudo update-alternatives — config java command. Find the Java 8 and Java 11 installed path.
🌐
OpenLogic
openlogic.com › openjdk-downloads
OpenJDK Downloads | OpenLogic
In August 2019, OpenLogic recognized that the current state of Java WebStart technology in OpenJDK was not as capable as the Oracle JDK equivalent. The build was missing critical functionality such as site exceptions, jar key matching, Windows Proxy settings, and other functions. OpenLogic added functionality to IcedTea-Web to bring parity with Oracle’s WebStart distribution. These upgrades were accepted into IcedTea-Web 2.0. OpenLogic now provides free, quarterly builds of OpenJDK 8, OpenJDK 11, OpenJDK 17, and OpenJDK 21 for Linux, Windows, and MacOS.
🌐
GitHub
gist.github.com › wagyourtail › b115f66d135b3818b63d9b27048d80e6
Installing Java 8 on various Linux distros · GitHub
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.8.0_151/bin/java" 1
🌐
Batsov
batsov.com › articles › 2021 › 12 › 10 › working-with-multiple-versions-of-java-on-ubuntu
Working with Multiple Versions of Java on Ubuntu | (think)
December 10, 2021 - You can easily install multiple versions of Java on Ubuntu via apt: Typically the newest version of Java you install will become the default, but you can easily change this: Notice that pressing 0 means “auto-select the newest Java available” (in our case Java 11). You can now select Java 8 by ...
🌐
Super User
superuser.com › questions › 1249099 › installing-jre-8-on-ubuntu
linux - Installing Jre 8 on Ubuntu - Super User
September 10, 2017 - update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_17/bin/java 1 update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_17/bin/javac 1 update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so 1 update-alternatives --set java /opt/jdk1.7.0_17/bin/java update-alternatives --set javac /opt/jdk1.7.0_17/bin/javac update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so ... Welcome to Super User. This question is several years old, and jdk8 wasn't in the Ubuntu repository at that time.