echo 'export JAVA_HOME=/opt/jdk1.6.0_06' > /etc/profile.d/jdk.sh
echo 'export PATH=$JAVA_HOME/bin:$PATH' >> /etc/profile.d/jdk.sh
"/opt/jdk1.6.0_06" replace to the actual java installation directory
echo 'export JAVA_HOME=/opt/jdk1.6.0_06' > /etc/profile.d/jdk.sh
echo 'export PATH=$JAVA_HOME/bin:$PATH' >> /etc/profile.d/jdk.sh
"/opt/jdk1.6.0_06" replace to the actual java installation directory