linux中查找jdk的安装路径
首先要申明一下which java是定位不到安装路径的。which java定位到的是java程序的执行路径。网上的资料都是人云亦云,完全不去思考。那么怎么定位到java的安装路径呢?下面我们来看看例子吧,如下所示:
[root@localhost ~]# java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
[root@localhost ~]# which java
/usr/bin/java
[root@localhost ~]# ls -lrt /usr/bin/java
lrwxrwxrwx. 1 root root 22 Aug 17 15:12 /usr/bin/java -> /etc/alternatives/java
[root@localhost ~]# ls -lrt /etc/alternatives/java
lrwxrwxrwx. 1 root root 46 Aug 17 15:12 /etc/alternatives/java -> /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
[root@localhost ~]#
[root@localhost ~]# cd /usr/lib/jvm
[root@localhost jvm]# ls
java-1.6.0-openjdk-1.6.0.0.x86_64 java-1.7.0-openjdk-1.7.0.65.x86_64 jre jre-1.6.0 jre-1.6.0-openjdk.x86_64 jre-1.7.0 jre-1.7.0-openjdk.x86_64 jre-openjdk
[root@localhost jvm]#
相关推荐
lonesomer 2020-09-17
Locksk 2020-10-12
佛系程序员J 2020-10-10
gdb 2020-09-14
zousongshan 2020-08-10
hell0kitty 2020-07-28
malonely 2020-07-20
missingmuch 2020-07-19
eternityzzy 2020-07-19
wangrui0 2020-06-28
一世为白 2020-06-21
MAC2007 2020-06-16
凉白开 2020-06-17
zhangwentaohh 2020-06-14
liangston 2020-06-14
linzb 2020-06-14
89421478 2020-06-12