wget 下载java1.8

转自https://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/
For 64Bit

使用wget下载

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.tar.gz"

tar xzf jdk-8u141-linux-x64.tar.gz

For 32Bit

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-i586.tar.gz"
tar xzf jdk-8u141-linux-i586.tar.gz

配置环境变量

JAVA_HOME=/home/weijun/jdk/jdk1.8.0_141
JRE_HOME=/home/weijun/jdk/jdk1.8.0_141/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH

更新

source /home/weijun/.profile

验证

java -version
javac -version

你可能感兴趣的:(安装)