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.comtry 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.
How do I install Java JRE on Linux?
java - How to install the JDK on Ubuntu Linux - Stack Overflow
software installation - command to install java jdk latest version on kali - Unix & Linux Stack Exchange
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.comVideos
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
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.