Centos 7.5 安装JDK

#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"

 

 


mkdir /usr/local/java/
tar -zxvf jdk-8u171-linux-x64.tar.gz -C /usr/local/java/

 

#vi /etc/profile

最后一行粘贴

#java environment
export JAVA_HOME=/usr/java/jdk1.8.0_144
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin

 

#source /etc/profile

 

java -version

posted on 2019-08-13 12:59  范兵  阅读(706)  评论(0编辑  收藏  举报

导航