#进入root目录
cd /root
#下载jdk
wget http://x.lisonghong.com/jdk/jdk-8u271-linux-x64.tar.gz

#解压
tar -zxvf jdk-8u271-linux-x64.tar.gz

#重命名
mv  jdk1.8.0_271 jdk1.8

echo "#脚本配置jdk开始" >> .bash_profile
echo "export JAVA_HOME=/root/jdk1.8" >> .bash_profile
echo "export JRE_HOME=\${JAVA_HOME}/jre" >> .bash_profile
echo "export CLASSPATH=.:\${JAVA_HOME}/lib\${JRE_HOME}/lib:\$CLASSPATH" >> .bash_profile
echo "export JAVA_PATH=\${JAVA_HOME}/bin:\${JRE_HOME}/bin" >> .bash_profile
echo "export PATH=\$PATH:\${JAVA_PATH}" >> .bash_profile
echo "#脚本配置结束" >> .bash_profile

cd /root

source .bash_profile

echo 'jdk1.8安装配置成功'

