CentOS下通过命令查找java环境变量
[root@yuteng opt]# echo $JAVA_HOME /usr/java/default [root@yuteng opt]# which java /usr/java/default/bin/java [root@yuteng opt]# ls -lrt /usr/java/default lrwxrwxrwx. 1 root root 8 Jul 24 10:37 /usr/java/default -> ./latest [root@yuteng opt]# ls -lrt /usr/java/default/bin/java -rwxr-xr-x. 1 10 143 7718 Apr 11 2015 /usr/java/default/bin/java
这里default做的软链接
[root@yuteng java]# ll /usr/java total 4 lrwxrwxrwx. 1 root root 8 Jul 24 10:37 default -> ./latest drwxr-xr-x. 8 10 143 4096 Apr 11 2015 jdk1.7.0_79 lrwxrwxrwx. 1 root root 13 Jul 24 10:37 latest -> ./jdk1.7.0_79