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).
🌐
Oracle
java.com › en › download › help › linux_install.html
How do I download and install 32-bit Java for Linux?
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.
Discussions

java - How to install the JDK on Ubuntu Linux - Stack Overflow
How to install Open JDK (Java developement kit) in Ubuntu (Linux)? Open Terminal from Application Dash or press Ctrl+Alt+T ... sudo apt install openjdk-8-jdk sudo apt install openjdk-8-source #this is optional, the jdk source code · For JAVA_HOME (Environment Variable) type command as shown ... More on stackoverflow.com
🌐 stackoverflow.com
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
How Do I Install Java On Linux???

I don't really understand what you meant by: And dont forget to check the "executable" box in properties (or chmod +x) Were do I do this?

But here is what heppened when I did sudo apt install openjdk-8-jre and then java -jar /home/(myusername)/Downloads/models.jar

WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by com.jtattoo.plaf.BasePanelUI (file:/home/(myusername)/Downloads/models.jar) to field javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP

WARNING: Please consider reporting this to the maintainers of com.jtattoo.plaf.BasePanelUI

WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

WARNING: All illegal access operations will be denied in a future release

Inconsistency detected by ld.so: dl-lookup.c: 112: check_match: Assertion `version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed!

This Sounds really bad...

EDIT: Open with OpenJDK java 8 runtime appeared when I right click it, but still nothing happens when I actually click it!

More on reddit.com
🌐 r/linux4noobs
4
2
March 11, 2020
Attempting to download Java 17 on Linux Mint
Installing oracle jdk is a hassle in linux. Install openjdk instead by using sudo apt install openjdk-17-jdk More on reddit.com
🌐 r/linuxmint
10
9
December 31, 2021
🌐
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 - If Java is not already installed, it will say "'Java', not found." ... Type sudo apt install default-jdk and press ↵ Enter. This is the command to install the latest version of Java Development Kit on your Ubuntu system.
🌐
Fabric Documentation
docs.fabricmc.net › players › installing-java › linux
Installing Java on Linux | Fabric Documentation
April 2, 2026 - For more information on installing Java on Arch Linux, see the Arch Linux Wiki. You can install the latest JRE from the official repositories: ... If you're running a server without the need for a graphical UI, you can install the headless version instead: ... You should refer to an alternative guide for your distribution if you plan to develop mods. Once the installation is complete, you can verify that Java 25 is installed by opening a terminal and typing java -version. If the command runs successfully, you will see something like shown before, where the Java version is displayed:
🌐
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
You don’t need to setup Java on Ubuntu if someone has already installed it for you. A quick java --version check will tell you if an install is necessary: java - version Command 'java' not found, but can be installed with: sudo apt install ...
🌐
Oracle
docs.oracle.com › en › java › javase › 21 › install › installation-jdk-linux-platforms.html
3 Installation of the JDK on Linux Platforms
July 15, 2025 - Download the key file from https://yum.oracle.com/RPM-GPG-KEY-oracle-ol9 using the following command: wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol9 ... Note:Public key installation needs to be done only once. The key installation is persistent across reboots. There are two OL-specific JDK RPM packages, jdk-21-headless and jdk-21-headful. When these packages are installed together, they provide full JDK functionality. Install jdk-21-headless package if you only need headless Java Runtime for running non-GUI applications.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › linux-unix › download-install-java-windows-linux-macos
Installing Java on Windows, Linux, and macOS - GeeksforGeeks
April 20, 2026 - The javac command is used to compile the Java program. ... Here, in this case the filename is file. We have successfully run our first Java program on Windows OS. Step 1: Visit the official oracle website https://www.oracle.com/in/java/. You will need to accept the terms of Oracle’s license agreement before downloading. On the download page, accept the Oracle Binary Code License Agreement for Java SE. Select the Linux version.
🌐
Scaler
scaler.com › home › topics › java › how to install java in linux?
How to Install Java in Linux? - Scaler Topics
July 5, 2024 - This will download and install the default version of JRE present in your Linux operating system's repository. Step 2: It will download some packages and ask for permission. Type Y for yes. Step 3: This will install Java and JRE in your machine. To verify again, check the version using the command java -version.
🌐
LinuxVox
linuxvox.com › blog › install-java-linux-command-line
Install Java on Linux via Command Line — linuxvox.com
This blog will guide you through the process of installing Java on Linux using the command line, covering fundamental concepts, usage methods, common practices, and best practices.
🌐
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 installation command. Type in tar zxvf, press the spacebar once, and then type in the full file name. This will vary depending on the Java version and when you downloaded it.
🌐
Oracle
java.com › en › download › help › linux_x64rpm_install.html
Linux 64-bit RPM Java installation instructions
Install the package. rpm -ivh jre-8u73-linux-x64.rpm To upgrade a package: rpm -Uvh jre-8u73-linux-x64.rpm
🌐
Oracle
docs.oracle.com › javase › › 9 › install › installation-jdk-and-jre-linux-platforms.htm
5 Installation of the JDK and JRE on Linux Platforms
To install the 64-bit JDK on an RPM-based Linux platform: Download the file, jdk-9.minor.security.patch_linux-x64_bin.rpm. Before you download a file, you must accept the license agreement. Ensure that you have root user access by running the command su and entering the superuser password. ... Note: JDK 9 can coexist with earlier versions of JDK. For each version, a new directory is created, the default directory being /usr/java/jdk.minor.security.patch.
🌐
Opensource.com
opensource.com › article › 19 › 11 › install-java-linux
How to install Java on Linux | Opensource.com
This is rare, but it does happen, and on Linux, you can use either the local install method (see Installing Java from a TAR file) or the alternatives application to deal with this conflict. The alternatives command looks at applications installed on your Linux system and lets you choose which version to use.
🌐
Ubuntu
ubuntu.com › tutorials › install-jre
Install the Java Runtime Environment | Ubuntu
Create a directory to install JRE in with: sudo mkdir /usr/local/java · Move the JRE binaries into the directory: sudo mv jre-8u291-linux-x64.tar.gz /usr/local/java · Go into the install directory: cd /usr/local/java · Unpack the tarball: ...
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-java-with-apt-get-on-ubuntu-16-04
How To Install Java with Apt-Get on Ubuntu 16.04 | DigitalOcean
April 23, 2016 - For this example, I installed Oracle JDK 7 in the /usr/lib/jvm/java-7-oracle directory. Scroll to the end of the file and enter the following: JAVA_HOME=/usr/lib/jvm/java-7-oracle export JAVA_HOME Save your file and exit gedit. Lastly, reload the system PATH with the following command: $ .
🌐
GitHub
github.com › chrishantha › install-java
GitHub - chrishantha/install-java: Installation script for setting up Java on Linux · GitHub
"install-java.sh" is an installation script for setting up Java Development Kit (JDK) on Debian based Linux Operating Systems. Currently, the install-java.sh script supports tar.gz distributions from Oracle, OpenJDK and AdoptOpenJDK · I'm mainly ...
Starred by 295 users
Forked by 146 users
Languages   Shell