下载jdk-8u111-linux-x64.tar.gz
tar zxvf jdk-8u111-linux-x64.tar.gz 到/usr/lib/jvm/
which java
# /usr/bin/java
ls -l /usr/bin/java
# lrwxrwxrwx 1 root root 22 Sep 20 21:22 /usr/bin/java -> /etc/alternatives/java
ls -l /etc/alternatives/java
# lrwxrwxrwx 1 root root 42 Sep 21 00:01 /etc/alternatives/java -> /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java
sudo rm /etc/alternatives/java
sudo ln -s /usr/lib/jvm/jdk1.8.0_111/bin/java /etc/alternatives/java
[email protected]:/usr/lib/jvm# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
编译通过
时间: 2024-10-24 11:33:57