Java on RHEL/CentOS

Archived

This page has been archived and will receive no further updates.

Environment variables

JAVA_HOME=/usr/lib/jvm/java
JRE_HOME=/usr/lib/jvm/jre

Install Java 6 JRE

sudo yum -y install java-1.6.0-openjdk

Install Java 6 JDK

sudo yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel

Install Java 7 JRE

sudo yum -y install java-1.7.0-openjdk

Install Java 7 JDK

sudo yum -y install java-1.7.0-openjdk java-1.7.0-openjdk-devel