This small article is intended to guide you to install Oracle Java (JDK) 6/7/8 in your Ubuntu/Linux Mint systems. For this, you will have to get the installer, available at the Launchpad PPA maintained by one of the popular Linux blogs- Webupd8.org, which will download and install the Oracle Java JDK6/7/8 from the sources.
InstallationAdd the repository.
Update the local repository.
sudo add-apt-repository ppa:webupd8team/java
Install the package.
sudo apt-get update
Replace N with appropriate number to install the corresponding version (6 for JDK6). Accept the license agreement and it will start fetching the relevant files from the source to begin the installation process.
sudo apt-get install oracle-javaN-installer
To set the default Java:
Again, replace N with appropriate number.
sudo apt-get install oracle-javaN-set-default
That's it !