Preparing your system java
First you need to remove openjdk for this run the following command from your terminal web
sudo apt-get purge openjdk* ubuntu
If you installed java 7 from any other PPA and you are having problem with java then you have to do following steps before installing the PPA menctioned here oracle
sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update this
Install oracle java 7 in ubuntu 12.04 rem
Open the terminal and run the following commands terminal
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer get
You can check the java version by searching java in dashboard it