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 >
To get a different version of java JRE/JDK as default in your OS:
sudo alternatives --install /usr/bin/java java [path_to_java_bin] 1
Example in my case was:
sudo alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_80/bin/java 1
Then run a config to select the alternative java version:
sudo /usr/sbin/alternatives --config java
Choose 1,2 or the option you desire
Then check the changes by doing:
java -version