Installing Java on Ubuntu 12.04 - to the novice can be a not so easy task .. but thanks to my installs of this OS on my server I believe I have it down pat .. here is what I do .. and this should work for you as well .. First you just want to make sure you are up to date
$ sudo apt-get update
Next
$ sudo apt-get upgrade
Next we will install python-software-properties This software provides an abstraction of the used apt repositories. It allows you to easily manage your distribution and independent software vendor software sources.
$ sudo apt-get install python-software-properties
  Now that this is installed we can install the repositories needed to install Oracle Sun Java
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer
  You can also install JDK
$ sudo apt-get install openjdk-7-jre
  Questions, Comments, Concerns - Leave them in the comments ~Jab