Use which and ls to track links.
# java -version
java version "1.8.0_72"
Java(TM) SE Runtime Environment (build 1.8.0_72-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.72-b15, mixed mode)
# which java
/usr/bin/java
# ls -al /usr/bin/java
lrwxrwxrwx 1 root root 22 January 24 13:51 2016 /usr/bin/java -> /etc/alternatives/java
# ls -al /etc/alternatives/java
lrwxrwxrwx 1 root root 34 January 24 13:51 2016 /etc/alternatives/java -> /usr/java/jdk1.8.0_72/jre/bin/java
There was a case where it was suspected that the java of the inherited server was old, and when I checked the location of java, it was as follows.
# ls -al /usr/java/
20 in total
drwxr-xr-x.4 root root 4096 August 20 09:43 2018 .
drwxr-xr-x.14 root root 4096 December 23 15:15 2015 ..
drwxr-xr-x 9 root root 4096 January 24 14:00 2016 apache-tomcat-8.0.30
lrwxrwxrwx 1 root root 16 January 24 13:51 2016 default -> /usr/java/latest
drwxr-xr-x 9 root root 4096 January 24 13:51 2016 jdk1.8.0_72
lrwxrwxrwx 1 root root 21 January 24 13:51 2016 latest -> /usr/java/jdk1.8.0_72
-rw-r--r--1 root root 3405 January 24 14:27 2016 velocity.log
I wanted to unpack the tar, but I didn't know if I was directly referencing jdk1.8.0_72 or using latest or default, so I checked.
After all, I installed rpm.
# ls -al /usr/java/
24 in total
drwxr-xr-x.5 root root 4096 August 20 09:56 2018 .
drwxr-xr-x.14 root root 4096 July 7 17:12 2018 ..
drwxr-xr-x 9 root root 4096 January 24 14:00 2016 apache-tomcat-8.0.30
lrwxrwxrwx 1 root root 16 January 24 13:51 2016 default -> /usr/java/latest
drwxr-xr-x 8 root root 4096 August 20 09:55 2018 jdk1.8.0_181-amd64
drwxr-xr-x 9 root root 4096 January 24 13:51 2016 jdk1.8.0_72
lrwxrwxrwx 1 root root 28 august 20 09:56 2018 latest -> /usr/java/jdk1.8.0_181-amd64
-rw-r--r--1 root root 3405 January 24 14:27 2016 velocity.log
# which java
/usr/bin/java
# ls -al /usr/bin/java
lrwxrwxrwx 1 root root 22 August 20 09:56 2018 /usr/bin/java -> /etc/alternatives/java
# ls -al /etc/alternatives/java
lrwxrwxrwx 1 root root 41 August 20 09:56 2018 /etc/alternatives/java -> /usr/java/jdk1.8.0_181-amd64/jre/bin/java
Recommended Posts