To install java in linux (I used CentOS, RHEL is same too), I used this command
rpm -Uvh /path/to/binary/jdk-7u55-linux-x64.rpm
and verified java >
For Ubuntu use update-alternatives
update-alternatives