Install Oracle Java SE 7 in Linux Mint 14

By default, Linux Mint 14 comes with pre-installed OpenJDK 1.7 for its Java Runtime Environment and there is no official Oracle Java SE in the package manager. So in some cases if you want to install Oracle Java SE 7 in Linux Mint, you can follow this tutorial. At the time of this writing, the latest version of Oracle Java SE is Java SE 7 Update 10.

1. Get the Java software from Oracle website. Select .tar.gz file format and the Linux platform you are using. It can be 32-bit or 64-bit.

2. To avoid the conflict, firstly we need to disable the OpenJDK environment

$ sudo chmod -x /usr/bin/java*

3. Extract the downloaded jdk file and move it to system folder such as /opt

$ tar zxf jdk-7u10-linux-x64.tar.gz 
$ sudo mv jdk1.7.0_10 /opt/
$ cd /opt/

4. Create a symbolic link to java folder. This makes the upgrade procedure easier later.

$ sudo ln -sf jdk1.7.0_10 java

5. Add the java binary path to the current PATH.

$ export PATH=$PATH:/opt/java/bin

6. Verify that it is installed correctly.

$ java -version
java version "1.7.0_10"
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

The PATH you set in the above step in temporary. To make it permanent and run at boot, add the path to .profile file in your $HOME directory.
Just append this line to the .profile file.

$ export PATH="$PATH:/opt/java/bin"

I hope this is helpful for you when installing Oracle Java SE 7 (JDK 1.7) on Linux Mint 14.