Linux/Java

Manual Installation
Java sudo su - cd /opt wget http://install.oeey.com/jdk-6u45-linux-amd64.rpm rpm -Uvh jdk-6u45-linux-amd64.rpm ln -s /usr/java/jdk1.6.0_23 java
 * 1) RPM
 * 1) http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR
 * 2) wget http://install.oeey.com/jdk-6u45-linux-x64-rpm.bin

sudo su - cd /opt wget http://install.oeey.com/jdk-6u45-linux-x64.bin chmod u+x jdk-6u45-linux-x64.bin ./jdk-6u45-linux-x64.bin ln -s jdk1.6.0_45 java
 * 1) Non-RPM
 * 1) http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR

echo "export JAVA_HOME=/opt/java" >> ~/.bashrc

Installation
Java SE JDK sh jdk-6u25-linux-x64-rpm.bin

Installed to: /usr/java/jdk1.6.0_25

Path: export PATH=/usr/java/jdk1.6.0_25/bin:$PATH

Java 8
yum -y install java-1.8.0-openjdk
 * 1) For RHEL

add-apt-repository -y ppa:webupd8team/java apt-get update echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections apt-get -y --force-yes install oracle-java8-installer oracle-java8-set-default
 * 1) For Ubuntu

Alternative
rpm -Uvh /path/to/binary/jdk-7u55-linux-x64.rpm

alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 200000

/usr/sbin/alternatives --display java

/usr/sbin/alternatives --config java

References:
 * How to Install Java 7 (JDK 7u55) on CentOS/RHEL 6/5 & Fedora - http://tecadmin.net/steps-to-install-java-on-centos-5-6-or-rhel-5-6/#
 * Install Oracle Java JDK/JRE 7u55 on Fedora 20/19, CentOS/RHEL 6.5/5.10 - http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/
 * Appendix A. Installing a Java Development Kit on Red Hat Enterprise Linux - https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_SOA_Platform/4.3/html/Getting_Started_Guide/appe-install_jdk_rhel.html