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.comjava - How to install the JDK on Ubuntu Linux - Stack Overflow
How do I install Java JRE on Linux?
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.comAttempting to download Java 17 on Linux Mint
Videos
try using this command in the terminal:
sudo apt install default-jre
then you can try using:
java -version
to check version
Do not download binaries straight from the Internet. That is not how to install software on Linux. It is how Windows users do it, but it is wrong on Linux.
Install it from the package manager. Google for instructions for your version, since you did not bother to tell us what you are running. Without detailed specific info we can't help you.
You appear to be setting JAVA_HOME and PATH only in the current terminal session.
You should adjust your JAVA_HOME and PATH variable in either .bashrc or .bash_profile in your home directory. Then maybe logout and back in. That way the PATH will be adjusted every time you open a new terminal.
https://docs.oracle.com/cd/E19062-01/sun.mgmt.ctr36/819-5418/gaznb/index.html https://linuxize.com/post/bashrc-vs-bash-profile/
With your above command you install java in your home directory. If the software is not explicitly required to be available to only this single user, I'd recommend to stick to the official filesystem hierarchy ( for example see here for a basic explanation The Linux Directory Structure, Explained ).
Since Oracle Java is a prime example for "proprietary software that doesn’t obey the standard file system hierarchy", it would best go to the /opt folder.
- Create a new folder with
sudo mkdir /opt/java - Move the .tar file there and extract it as sudo
- Optionally: Install a symlink to the /usr directory, to run java without the full path
sudo update-alternatives --install /usr/bin/java java PATH_TO_BINARY_HERE 100
Not quite sure what the JAVA_HOME variable is needed for. In Oracle's install manual it is not mentioned. If you do need this to be persistent, you'd have to add it to .bashrc or .bash_profile .
Referring to Ask Ubuntu question How to set JAVA_HOME for OpenJDK?,
How to install Open JDK (Java developement kit) in Ubuntu (Linux)?
Open Terminal from Application Dash or press Ctrl+Alt+T
Update repository:
sudo add-apt-repository ppa:openjdk-r/ppa # only Ubuntu 17.4 and earlier sudo apt updateOptional: To search available distributions of
openjdk, use the following command:apt search openjdkInstall the appropriate version with the following command:
sudo apt install openjdk-8-jdk sudo apt install openjdk-8-source #this is optional, the jdk source codeFor
JAVA_HOME(Environment Variable) type command as shown below, in "Terminal" using your installation path...export JAVA_HOME=/usr/lib/jvm/java-8-openjdk(Note:
/usr/lib/jvm/java-8-openjdkis symbolically used here just for demostration. You should use your path as per your installation.)For
PATH(Environment Variable) type command as shown below, inTerminal:export PATH=$PATH:$JAVA_HOME/binTo check your installation:
java -version
The following used to work before the Oracle Java license changes in early 2019.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
The PPA is discontinued, until the author finds a workaround for the license issues.
I followed the instructions on the Java official website but when I tried to run some thing related to JRE on the terminal it says Java not found