最近想用centos服务器开java服,但是java在linux环境下配置太麻烦,干脆做了个一键脚本,可安装最新版jdk20,
yum install -y wget && wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" "https://download.oracle.com/java/20/latest/jdk-20_linux-x64_bin.tar.gz" && tar -xvf jdk-20_linux-x64_bin.tar.gz && rm -f jdk-20_linux-x64_bin.tar.gz && mv jdk-20 /opt && echo 'export JAVA_HOME=/opt/jdk-20' >> /etc/profile && echo 'export PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile && source /etc/profile