1、centos7 安裝jdk
oracle官方下載jdk:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html? 下載? 官網(wǎng) .tar.gz 安裝包
2隘世,然后 scp 上傳服務(wù)器
scp /Users/wanggq/Downloads/jdk-8u161-linux-x64.tar.gz root@111.231.63.232:/root/java/jdk-8u161-linux-x64.tar.gz
3、解壓
tar -zxvf? jdk-8u161-linux-x64.tar.gz
4惕稻、配置環(huán)境變量
vi /etc/profile
文件加入:
export JAVA_HOME=/root/java/jdk1.8.0_161
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
source/etc/profile
java
java -version