Last updated on September 9, 2020 by Dan Nanni
Java Runtime Environment (JRE) or Java Runtime is a minimal set of Java SDK, which allows one to run Java applications. JRE consists of Java Virtual Machine (JVM), libraries, and other supporting components. If you want to run a complied Java application, you do not have to install a full-featured Java development kit, but just need JRE installed.
There are two choices for setting up JRE on Linux: use either Oracle JRE or OpenJDK JRE (open source implementation of the Java Platform). Choose either one you prefer, as described in the following.
Go to Oracle website, and click on JRE Download
link.
On the next page, accept Oracle license agreement. Then download a file according to your Linux system:
jre-7u45-linux-i586.tar.gz
(32-bit) or jre-7u45-linux-x64.tar.gz
(64-bit)
jre-7u45-linux-i586.rpm
(32-bit) or jre-7u45-linux-x64.rpm
(64-bit)
To install Oracle JRE on RPM-based Linux:
$ sudo rpm -ivh jre1.7.0_45-linux-<arch>.rpm
To install Oracle JRE on non RPM-based Linux:
$ sudo mkdir -p /usr/java $ sudo tar xvfvz jre1.7.0_45-linux-<arch>.tar.gz -C /usr/java
After installation, set the following environment variables in ~/.bashrc
JAVA_HOME=/usr/java/jre1.7.0_45 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
To install OpenJDK Java Runtime on Debian, Ubuntu or Linux Mint:
$ sudo apt-get install openjdk-7-jre
To install OpenJDK Java Runtime on Fedora, CentOS or RHEL:
$ sudo yum install java-1.7.0-openjdk
After installation, set JAVA_HOME environment variable in ~/.bashrc
JAVA_HOME=/etc/alternative/jre
If you cannot find /etc/alternative/jre
folder, set JAVA_HOME
to an alternative path (e.g., /usr/lib/jvm/default-java
).
This website is made possible by minimal ads and your gracious donation via PayPal or credit card
Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.
Xmodulo © 2021 ‒ About ‒ Write for Us ‒ Feed ‒ Powered by DigitalOcean