Linux安装jdk
1. 下载jdk:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. 解压:
2.1 # mkdir /usr/local/java
2.2 # tar zxvf jdk-8u171-linux-x64.tar.gz -C /usr/local/java/
3. 配置环境变量
3.1 # vi /etc/profile
3.2 文件尾部添加:
export JAVA_HOME=/usr/local/java/jdk1.8.0_171
export PATH=$JAVA_HOME/bin:$PATH
3.3 让文件生效:
# source /etc/profile
4. 验证是否安装成功:
4.1 # java -version
posted on 2018-07-08 12:17 changlezhong 阅读(110) 评论(0) 编辑 收藏 举报