直接上安装脚本
cat << "EOF" > install.sh
#!/bin/bash
my_path=$( cd $(dirname $0);pwd)
cd $my_path
wget http://download2.zhufunin.com/java-jdk/OpenJDK8U-jdk_x64_linux_hotspot_8u362b09.tar.gz
tar zxf OpenJDK8U-jdk_x64_linux_hotspot_8u362b09.tar.gz -C /usr/local/
cat << "EOF" >> /etc/profile
export JAVA_HOME=/usr/local/jdk8u362-b09/
export JRE_HOME=/usr/local/jdk8u362-b09/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
EOF
ln -s /usr/local/jdk8u362-b09/bin/java /usr/bin/
java -version
EOF
标签:11,bin,tar,openjdk,export,usr,HOME,local,debian
From: https://www.cnblogs.com/faberbeta/p/17124467.html