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
This procedure installs the Java Runtime Environment (JRE) for 64-bit Linux, using an archive binary file (.tar.gz). Go to http://java.com and click on the Download button.
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
java - How to install the JDK on Ubuntu Linux - Stack Overflow
Note: This is an old question and the answers reflect the world as it was then. Modern Ubuntu distributions have OpenJDK available which can be installed with sudo apt install default-jdk I am tr... More on stackoverflow.com
🌐 stackoverflow.com
software installation - command to install java jdk latest version on kali - Unix & Linux Stack Exchange
Kali Linux is based on Debian where default-jdk is a "recommended" or best Java SDK version which currently is openjdk-11-jdk. If you need Java 15 you need to install openjdk-15-jdk which (based on the Kali Linux Package Tracker) should be available in Kali. More on unix.stackexchange.com
🌐 unix.stackexchange.com
November 28, 2020
Help getting started developing in linux

Java is a write once, run anywhere language, meaning you don't need anything special other than the JDK and a Linux compatible IDE.

For the JDK you can either use OpenJDK (An opensource implementation of Java / JDK) or Oracle's JDK (Original and most used JDK). OpenJDK is easily available through sources like Ubuntu's Software Centre whereas Oracle's JDK is a bit more painful to install (Depending on the distro), but this is a great resource to make it easier (For Debian based systems like Ubuntu).

As for an IDE you're already on the right track. Both Eclipse and IntelliJ are great options and have cross-platform support.

More on reddit.com
🌐 r/java
8
0
August 12, 2012
🌐
Oracle
oracle.com › java › technologies › downloads
Download the Latest Java LTS Free
Includes a complete JRE plus tools for developing, debugging, and monitoring Java applications. Running headless Linux workloads at or near your systems' CPU or memory limits · Enterprise Performance Pack brings significant memory and performance improvements including modern garbage collection algorithms, reduced memory usage and many other optimizations. ... Server Java Runtime Environment (Server JRE). For deploying Java applications on ...
🌐
GeeksforGeeks
geeksforgeeks.org › linux-unix › download-install-java-windows-linux-macos
Installing Java on Windows, Linux, and macOS - GeeksforGeeks
April 20, 2026 - Select the Linux version. If you are using a standard 64-bit system, select the file for x64 architecture. If you are using an ARM-based system, select the file for arm64. Download the .tar.gz file for Linux.
Find elsewhere
🌐
ArchWiki
wiki.archlinux.org › title › Java
Java - ArchWiki
May 15, 2026 - Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. Arch Linux officially supports the open source OpenJDK versions 8, 11, 17, 21, and 25 — Long-Term Support (LTS) versions, and 26 — the latest released version. All these JVMs can be installed without conflict and switched between using helper script archlinux-java (installed with java-runtime-common package).
🌐
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 ·
🌐
freeCodeCamp
freecodecamp.org › news › how-to-install-java-in-ubuntu
How to Install Java in Ubuntu – JDK Linux Tutorial
August 11, 2024 - You might get N: Download is performed unsandboxed as root as file '/home/fahim/Downloads/jdk-20_linux-x64_bin.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied). But don't worry about that because we performed the installation "unsandboxed" intentionally. You will not face any problems if you use the Debian package downloaded from the right source. You can clear the terminal using the command clear. We need to make sure that if it updates, it does not download any downgraded version of Java.
🌐
OpenJDK
openjdk.org
OpenJDK
Installing · Contributing · Sponsoring · Developers' Guide · Vulnerabilities · JDK GA/EA Builds · Mailing lists · Wiki · IRC · Mastodon · Bluesky · Bylaws · Census · Legal · AI · Workshop · JEP Process · Source code · GitHub · Mercurial · Tools ·
🌐
TutorialsPoint
tutorialspoint.com › article › installing-java-on-linux-using-ssh
Installing Java on Linux using SSH
March 17, 2026 - Multiple Java versions Use sudo update-alternatives --config java to switch between versions. Installing Java on Linux using SSH is a straightforward process that involves checking for existing installations, installing the OpenJDK package, setting environment variables, and testing the installation.
🌐
Atlantic.Net
atlantic.net › home › blog › how to install and manage java versions on oracle linux
How to Install and Manage Java Versions on Oracle Linux
December 28, 2025 - This post will show you how to install and manage different Java versions on Oracle Linux 10.
🌐
Visual Studio Code
code.visualstudio.com › docs › languages › java
Java in Visual Studio Code
November 3, 2021 - Alternatively, you can add Java language support to VS Code by installing the popular Java extensions by yourself. Download VS Code - If you haven't downloaded VS Code yet, quickly install for your platform (Windows, macOS, Linux).
🌐
Scaler
scaler.com › home › topics › java › how to install java in linux?
How to Install Java in Linux? - Scaler Topics
July 5, 2024 - It will give Java version installed. Step 1: Now, let's install JDK in Linux using the command sudo apt install default-jdk. This will download and install the default version of JRE present in the repository of your Linux operating system.
🌐
Oracle
java.com › en › download › help › download_options.html
How do I install Java ?
However, only the root user can install Java into the system location. Java on RPM-based Linux Platforms 32-bit RPM-based Linux platforms, such as Red Hat and SuSE, use a RPM binary file (.rpm) in the system location. You must be root to perform this installation.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install java on centos and rocky linux
How to Install Java on CentOS and Rocky Linux
December 16, 2025 - Install it by following the steps below: ... 2. Select the desired Java SE version on the webpage and click the download link for the RPM package. 3. After the download is complete, install the package with the command below: sudo yum localinstall ...
🌐
SDKMAN!
sdkman.io
Home | SDKMAN! the Software Development Kit Manager
Install Software Development Kits for the JVM such as Java, Scala, Kotlin and Groovy. Ant, Gradle, Grails, Maven, SBT, Spark, Spring Boot, Vert.x and many others also supported. Written in Rust and bash and only requires curl, zip, and unzip dependencies to be present on your system. Even works with ZSH too. Operates seamlessly across various UNIX-based platforms, including macOS, Linux...
🌐
Ubuntu
ubuntu.com › tutorials › install-jre
Install the Java Runtime Environment | Ubuntu
(Alternatively, you may opt to use a specific Java version, using for example the openjdk-11-jre package; as updates are released for that version of the Java Virtual Machine, that packages will be updated, allowing you to stick to the latest and greatest update of one specific version of the Java language.) ... openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2) OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2, mixed mode) (Although the output may change in the future as new Java versions are promoted to LTS status, or the current LTS version receives updates.) And that’s it! In the next step we’ll install Oracle HotSpot JRE.