Using Oracle Java 7 is not formally supported by Ubuntu. There's plenty solutions for installing it, listed on https://help.ubuntu.com/community/Java .
The simplest one listed is this one:
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer
It'll keep your java 7 installation up to date.
To automatically set up the Java 7 environment variables JAVA_HOME and PATH:
sudo apt-get install oracle-java7-set-default