#!/bin/bash
cd /usr/local/src
wget http://192.168.5.222/jdk-8u11-linux-x64.tar.gz
tar zxvf jdk-8u11-linux-x64.tar.gz -C /opt
mv /opt/jdk1.8.0_11 /opt/jdk
cat >> /etc/profile <<EOF
export JAVA_HOME=/opt/jdk
export JRE_HOME=/opt/jdk/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH
EOF
source /etc/profile