1 切换到java8安装包目录
cd /home/zcgl/AssetManagerNecessary/java
2 解压java安装包
sudo tar -xzvf jdk-8u171-linux-x64.tar.gz
3 移动解压文件到/usr/local/jdk_xxx
sudo mv jdk1.8.0_171 /usr/local/
4 创建软链接
sudo ln -s /usr/local/jdk1.8.0_171 /usr/local/jdk
5 导出java路径
export JAVA_HOME=/usr/local/jdk
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
6 使导出路径生效
source ~/.profile
7 测试java 安装是否成功
java -version
网友评论