I faced some problem to install Oracle Java JDK installing on ubuntu 12.04 . here is a solution I found and it’s worked for me.
Here is step by step instruction of install Java Runtime .
Open Terminal. Then, run the commands below to remove all other installations of OpenJDK from your system.
sudo apt-get purge openjdk*
Then, go and download Java JDK package from here.
Run the below commands to extract the java packages you downloaded.
tar -xvf ~/Downloads/jdk-7u3-linux-i586.tar.gz
Now create your java folder by running the commands below.
sudo mkdir -p /usr/lib/jvm/jdk1.7.0
Now run this command for move all the extracted files and folders into the java folder.
sudo mv jdk1.7.0_03/* /usr/lib/jvm/jdk1.7.0/
Next, run those commands as shown below one-at-a-time to enable Java JDK. Remember to press Enter after each line.
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1