#------java升级------
下载版本tar包
# wget http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1505727563_a9959e1f77adf792ce012dc8e6c953ad
# mv jdk-8u144-linux-x64.tar.gz?AuthParam=1505727563_a9959e1f77adf792ce012dc8e6c953ad jdk-8u144-linux-x64
在 /usr 目录下新建一个文件夹,用于存放下载的JDK源码
# mkdir /usr/java
解压放在/use/java下
# tar -zxvf jdk-8u144-linux-x64 -C /usr/java
设置环境变量
# vim /etc/profile
export JAVA_HOME=/usr/local/jdk1.8.0
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
启用修改
# source /etc/profile
验证
# java -version
网友评论