CentOS 7 查看Java安装路径

/ Linux / 226浏览

1.which java
[root@iZm5e5rn6xcyrhrlgmxo3tZ init.d]# which java
/usr/bin/java

2.ls -lrt /usr/bin/java
[root@iZm5e5rn6xcyrhrlgmxo3tZ lib]# ls -lrt /usr/bin/java
lrwxrwxrwx 1 root root 22 12月 6 2016 /usr/bin/java -> /etc/alternatives/java

3.ls -lrt /etc/alternatives/java
[root@iZm5e5rn6xcyrhrlgmxo3tZ lib]# ls -lrt /etc/alternatives/java
lrwxrwxrwx 1 root root 35 12月 6 2016 /etc/alternatives/java -> /usr/java/jdk1.8.0_111/jre/bin/java

最终java路径为:/usr/java/jdk1.8.0_111