Linux Mint: install Oracle Java 7 / 8

If you really need to use Oracle Java 7 instead of OpenJDK in Linux Mint, here’s an easy way to do it: a PPA repository to install and keep your computer up to date with the latest Oracle Java 7 (Java JDK which includes JRE). Oracle JDK7 itself is not hosted in the PPA because that’s not allowed by the new Java license. Based on the original article by Webupd8 (java 8). Webupd8 (java 8)

This package from webupd8team provides Oracle Java JDK 7 (which includes Java JDK, JRE and the Java browser plugin). However, you can’t only install Oracle JRE – the PPA only provides the full Oracle JDK7 package.

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
</pre
After the installation finishes, if you wish to see if it was successful, you can run the following command:
<pre lang="bash">
java -version

After the installation finishes, if you wish to see if it was successful, you can run the following command:

java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

To automatically set up the Java 7 environment variables, you can install the following package:

sudo apt-get install oracle-java7-set-default

If you don’t want to use Oracle Java (JDK) 7 anymore and want to go back to OpenJDK, all you have to do is remove the Oracle JDK7 Installer and the previous Java (OpenJDK, etc.) version will be used:

sudo apt-get remove oracle-java7-installer

Leave a Reply