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
If you are installing another version, ... 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. Note about root access: To install Java in a system-wide location such as /usr/local, you must login as the root user to gain the ...
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
No matter what operating system you're running, there are usually several ways to install an application.
🌐
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 - You can also click the Linux X64 version if you want to install 64-bit Java. ... Note the file's name. The latest version of Java is version 8, but you also need the update version number, which is written in the file name after the "8u" section. For example, your file might be named "jre-8u151", signifying that it is version 8, update 151. ... Open the command line. This step will vary depending on your version of Linux, but you can usually find the command line by opening the Terminal ...
🌐
Scaler
scaler.com › home › topics › java › how to install java in linux?
How to Install Java in Linux? - Scaler Topics
July 5, 2024 - This article by Scaler topics consists of detailed installation steps of different software packages required to run java programs in the Linux operating system.
🌐
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 - Do you need to run Java programs on Ubuntu? Perhaps you want to use Java to create applications. Java is a general-purpose programming language that is designed to run on any platform with as few dependencies as possible. Java Runtime...
🌐
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 this page. We recommend using OpenJDK 25, which is available for most Linux distributions. ... For more information ...
Find elsewhere
🌐
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, ... 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 ...
🌐
Linux TLDR
linuxtldr.com › home › java installation on linux with hands-on examples
Java Installation on Linux with Hands-on Examples
December 29, 2025 - You can experience this hands-on once you learn how to install Java in your preferred Linux distribution by following this article, replete with prominent examples. ... It would be beneficial to become familiar with the terminology of JDK, JRE, and JVM before moving forward because programmers frequently use ...
🌐
Programguru
programguru.org › home › java course › install java on linux
Install Java on Linux
Learn how to install Java on any Linux distribution using simple terminal commands. This step-by-step guide covers both OpenJDK and Oracle JDK installations with examples and output explanations.
🌐
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 - Java Build tools (Maven, Gradle, and so on) and your code editors use Java applications behind the scenes to give developers a nice experience running, creating, and maintaining applications. Let’s see how to install Java in a Linux environment using the terminal.
🌐
Upgrad
upgrad.com › home › tutorials › software & tech › how to install java in linux
How to Install Java in Linux: A Step-by-Step Guide
May 1, 2025 - If Java is installed, the terminal will display the version information. If it's not installed, you'll receive an error, indicating you need to install it. OpenJDK is a fully open-source implementation of Java and is widely used in both development and production environments. It provides everything you need for Java development and is suitable for most users. While Oracle JDK has some additional features and support, OpenJDK is often sufficient for most Linux ...
🌐
LinuxVox
linuxvox.com › blog › install-java-linux-command-line
Install Java on Linux via Command Line — linuxvox.com
Java is a widely-used programming language known for its platform - independence, security, and robustness. It powers a vast array of applications, from web and mobile apps to enterprise-level software. Installing Java on a Linux system using the command line offers a quick, efficient, and ...
🌐
OperaVPS
operavps.com › docs › install java in linux easily and quickly
✅ Install Java in Linux Guide Step by Step
1 month ago - Verify the installation by checking ... simple terminal commands. ... Installing Java in Linux involves using the native package manager like apt or yum to check existing installations, update the system, install the Java Development Kit or Runtime Environment, and verify the setup. Users can install ...
🌐
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 ...
🌐
GeeksforGeeks
geeksforgeeks.org › linux-unix › download-install-java-windows-linux-macos
Installing Java on Windows, Linux, and macOS - GeeksforGeeks
April 20, 2026 - This is the format used for installing Java on most Linux systems. Step 2: Now, open the terminal on your Linux system and navigate to the folder where you downloaded the file.
🌐
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 ...