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.
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.
Install Oracle JRE on Linux
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:
- Non-RPM based Linux (e.g., Debian, Ubuntu, Mint): jre-7u45-linux-i586.tar.gz (32-bit) or jre-7u45-linux-x64.tar.gz (64-bit)
- RPM-based Linux (e.g., Fedora, CentOS, RHEL): jre-7u45-linux-i586.rpm (32-bit) or jre-7u45-linux-x64.rpm (64-bit)
To install Oracle JRE on RPM-based Linux:
To install Oracle JRE on non RPM-based Linux:
$ sudo tar xvfvz jre1.7.0_45-linux-<arch>.tar.gz -C /usr/java
After installation, set the following environment variables in ~/.bashrc
Install OpenJDK Java Runtime on Linux
To install OpenJDK Java Runtime on Debian, Ubuntu or Linux Mint:
To install OpenJDK Java Runtime on Fedora, CentOS or RHEL:
After installation, set JAVA_HOME environment variable in ~/.bashrc
If you cannot find /etc/alternative/jre folder, set JAVA_HOME to an alternative path (e.g., /usr/lib/jvm/default-java).
Subscribe to Ask Xmodulo
Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!