The .rpm file is not for Ubuntu, but for Fedora, CentOS, and other distros based on Fedora.
You'd want to download the .tar.gz file. To install Java in Ubuntu 12.04, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
And after the installation finishes, if you wish to see if it was successful, you can run the following command:
java -version
Or if you want to download the file , then see How to install a .tar.gz (or .tar.bz2) file
Source:WebUpd8