Open Terminal ( Ctrl + Alt + T ).
Remove the OpenJDK from the system if already you have it installed.
raj@geeksite~/$ sudo apt-get remove --purge openjdk*
Add repository.
raj@geeksite~/$ sudo apt-add-repository ppa:flexiondotorg/java
Update the repository on your system. Ignore if any error occur.
raj@geeksite~/$ sudo apt-get update
Install Sun Java6 and its plugins. Note: It might verify the installation of packages, type Y to confirm.
raj@geeksite~/$ sudo apt-get install sun-java6-jre sun-java6-jdk
Verify the installation.
You can also verify by visiting the following link.
That’s all.