mkdir /usr/local/java
cd /usr/local/java
echo "mkdir success"
wget http://192.168.1.81:1212/jdk-8u321-linux-x64.tar.gz
echo "wget success"
tar -zxvf /usr/local/java/jdk-8u321-linux-x64.tar.gz
echo "tar success"
cat >> /etc/profile << EOF
JAVA_HOME=/usr/local/java/jdk1.8.0_321
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH
EOF
echo "cat success"
source /etc/profile
echo "JDK is installed"