try using this command in the terminal:

sudo apt install default-jre

then you can try using:

java -version

to check version

Answer from neoMidori on askubuntu.com
🌐
Oracle
java.com › en › download › help › linux_x64_install.html
Linux 64-bit installation instructions for Java
Type: cd directory_path_name For example, to install the software in the /usr/java/ directory, Type: cd /usr/java/ Move the .tar.gz archive binary to the current directory. Unpack the tarball and install Java tar zxvf jre-8u73-linux-x64.tar.gz The Java files are installed in a directory called jre1.8.0_73 in the current directory.
Discussions

How do I install Java JRE on Linux?
Do you need to install Oracle's Java? Cuz if you don't need you can just open a terminal and type sudo apt install default-jre -y and it's ready to use (if you're on debian-based distros) More on reddit.com
🌐 r/linuxquestions
15
7
February 16, 2021
Does anyone here know how to use Lanterna?
I've tried the Wiki but the documentation isn't really there. It's a great library but I just can't figure out how the fuck to use it. Can someone… More on reddit.com
🌐 r/java
8
9
September 23, 2014
🌐
Opensource.com
opensource.com › article › 19 › 11 › install-java-linux
How to install Java on Linux | Opensource.com
Finally, unarchive the tarball into the directory you've chosen. $ tar --extract --file openjdk*linux-x64_bin.tar.gz \ --directory=$HOME/bin · Java is now installed. If you download an RPM or DEB file from Azul.com, then you can use your package manager to install it.
🌐
Wikihow
wikihow.com › computers and electronics › operating systems › linux › 4 ways to install java on linux - wikihow
4 Ways to Install Java on Linux - wikiHow
May 1, 2026 - Enter the root command. Type in sudo su and press ↵ Enter. This will prompt the command line to request your user password.[2] X Research source ... Enter your account password.
🌐
Wikihow
wikihow.com › computers and electronics › operating systems › linux › ubuntu › 4 easy ways to install java in ubuntu using terminal - wikihow
4 Easy Ways to Install Java in Ubuntu Using Terminal - wikiHow
December 17, 2025 - It has an icon that resembles a black screen with a white cursor. ... Type sudo apt update and press ↵ Enter. This updates the "apt" software repository so that you are running the latest version.
🌐
Scaler
scaler.com › home › topics › java › how to install java in linux?
How to Install Java in Linux? - Scaler Topics
July 5, 2024 - Use source /etc/environment to go to the environment file. Step 8: Check the path of JAVA_HOME variable using the command echo $JAVA_HOME. The echo command will print the path stored in the variable on the terminal. It will show the path you just set as an output, which signifies that we have correctly set the environment variable. /usr/lib/jvm/java-11-openjdk-amd64/bin/java · Your Linux machine is ready to develop and run Java applications.
🌐
Oracle
java.com › en › download › help › linux_install.html
How do I download and install 32-bit Java for Linux?
Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal. ... Java for RPM based Linux Platforms 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. Note that, as in the preceding example, the version number is sometimes preceded with the letter u and sometimes it is preceded with an underbar, for example, jre1.8.0_73.
Find elsewhere
🌐
Guru99
guru99.com › home › java tutorials › how to install java in ubuntu (linux)
How to Install Java in Ubuntu (Linux)
September 16, 2024 - JAVA_HOME=<Directory where JAVA has been extracted>/jdk1.8.0 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin export JAVA_HOME export PATH ... Step 7) Its time to let Ubuntu know where our JDK/JRE is located. Copy-paste below lines into a command prompt. sudo update-alternatives --install "/usr/bin/java" "java" "<Directory where JAVA has been extracted>/bin/java" 1 sudo update-alternatives --install "/usr/bin/javac" "javac" "<Directory where JAVA has been extracted>/bin/javac" 1 sudo update-alternatives --install "/usr/bin/javaws" "javaws" "<Directory where JAVA has been extracted>/bin/javaws" 1
🌐
Fabric Documentation
docs.fabricmc.net › players › installing-java › linux
Installing Java on Linux | Fabric Documentation
April 2, 2026 - Open a terminal, type java -version, and press Enter. ... To use Minecraft 26.1, you'll need at least Java 25 installed. If this command displays any version lower than 25, you'll need to update your existing Java installation; keep reading ...
🌐
Linux TLDR
linuxtldr.com › home › java installation on linux with hands-on examples
Java Installation on Linux with Hands-on Examples
December 29, 2025 - $ sudo zypper install java-11-openjdk -y #Include JDK and JRE · Once the installation is successfully completed, you can use the following command to verify that Java is accessible from your terminal by checking its version: ... After installing Java on your Linux system, you can run Java programs using the Java Runtime Environment (JRE) or the Java Development Kit (JDK).
🌐
Programguru
programguru.org › home › java course › install java on linux
Install Java on Linux
cd ~/Downloads tar -xvf jdk-21_linux-x64_bin.tar.gz sudo mv jdk-21 /usr/lib/jvm/jdk-21 · sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-21/bin/java 1 sudo update-alternatives --config java · It's important to let your system know where Java is located. To do this, follow these steps: Use any text editor to open your shell configuration file. Use the command based on your shell: ... In nano, press Ctrl + O to save, then Ctrl + X to exit.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-install-java-in-ubuntu-jdk-linux-tutorial
How to Install Java in Ubuntu – JDK Linux Tutorial
June 28, 2022 - Now, close and reopen your terminal to use sdkman. # print sdkman version to verify installation $ sdk versionSDKMAN 5.15.0 # install latest java $ sdk install java # check your java installation and print your java’s version $ java –version Openjdk version "17.0.3" 2022-04-19OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing) # Show path to current java version$ which java/home/sesigl/.sdkman/candidates/java/current/bin/java
🌐
LinuxVox
linuxvox.com › blog › install-java-linux-command-line
Install Java on Linux via Command Line — linuxvox.com
Use Package Managers: Whenever possible, use the system's package manager to install Java as it simplifies the installation and update process. Test the Installation: After installation, run some simple Java programs to ensure that the Java environment is working correctly. Installing Java on Linux via the command line is a straightforward process once you understand the fundamental concepts and usage methods.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install java on ubuntu
How to Install Java on Ubuntu
February 20, 2025 - This step-by-step guide will show you how to install Java on Ubuntu. ... A user account with sudo or root privileges. Access to the terminal. An Ubuntu Linux system. Java is a versatile, high-level programming language for building applications across various platforms. To accommodate different use cases, Java is divided into ...
🌐
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
If the java -version command outputs information about the version of Java installed, along with information about the JVM and runtime environment, then you successfully installed Java on Ubuntu with apt. Configuring JAVA_HOME isn’t absolutely required, but many enterprise Java applications such as Tomcat or Kafka query the JAVA_HOME directory when they startup and use that information at runtime, so it’s prudent to configure it.
🌐
The Knowledge Academy
theknowledgeacademy.com › blog › install-java-linux
How to Install Java on Linux: Step By Step Installation Guide
April 23, 2026 - To verify the variable, check what's stored in the variable. Use source /etc/environment to access the environment file. Step 8: To verify the value of the JAVA_HOME variable, you can use the command echo $JAVA_HOME. This command will display the location of your Java installation on the terminal. It will show the path you just set as an output, which signifies that you have correctly set the environment variable. /usr/lib/jvm/java-11-openjdk-amd64/bin/java · Now, your Linux machine is ready to develop and run Java applications.
🌐
OperaVPS
operavps.com › docs › install java in linux easily and quickly
✅ Install Java in Linux Guide Step by Step
1 month ago - For example, on Ubuntu, run 'sudo apt update' followed by 'sudo apt install default-jdk' to install the Java Development Kit. Open a terminal and type 'java -version'. If Java is installed, the version information will be displayed.