[LINUX]CentOS7查看Java文件安装路径

[LINUX]CentOS7查看Java文件安装路径

请支持原创,认准DannisTang([email protected]

使用echo查看文件位置的话,前提是配置安装了环境变量java_home,否则是找不到的文件路径位置的

[root@Redhat6 bin]# echo $JAVA_HOME

[root@Redhat6 bin]# java -version
java version "1.7.0_131"
OpenJDK Runtime Environment (rhel-2.6.9.0.el6_8-x86_64 u131-b00)
OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)
[root@Redhat6 bin]# 

使用which的话,是能找到java的程序执行路径,要一步一步的去找到java的安装路径

[root@Redhat6 ~]# which java
/usr/bin/java
[root@Redhat6 java]# ls -lrt /usr/bin/java
lrwxrwxrwx. 1 root root 22 Sep  7 06:03 /usr/bin/java -> /etc/alternatives/java
[root@Redhat6 java]# ls -lrt /etc/alternatives/java
lrwxrwxrwx. 1 root root 46 Sep  7 06:03 /etc/alternatives/java -> /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
[root@Redhat6 java]# cd /usr/lib/jvm
[root@Redhat6 jvm]# ls
java                                 jre
java-1.5.0-gcj-1.5.0.0               jre-1.5.0
java-1.6.0                           jre-1.5.0-gcj
java-1.6.0-openjdk-1.6.0.41.x86_64   jre-1.6.0
java-1.6.0-openjdk.x86_64            jre-1.6.0-openjdk.x86_64
java-1.7.0                           jre-1.7.0
java-1.7.0-openjdk-1.7.0.131.x86_64  jre-1.7.0-openjdk.x86_64
java-1.7.0-openjdk.x86_64            jre-gcj
java-openjdk                         jre-openjdk
[root@Redhat6 jvm]# cd java
[root@Redhat6 java]# ll
total 216
-r--r--r--. 1 root root   1503 Feb  7  2017 ASSEMBLY_EXCEPTION
drwxr-xr-x. 2 root root   4096 Sep 14 17:50 bin
drwxr-xr-x. 3 root root   4096 Sep  7 06:10 include
drwxr-xr-x. 4 root root   4096 Sep  7 06:02 jre
drwxr-xr-x. 3 root root   4096 Sep 14 17:50 lib
-r--r--r--. 1 root root  19263 Feb  7  2017 LICENSE
drwxr-xr-x. 2 root root   4096 Sep  7 06:10 tapset
-r--r--r--. 1 root root 172264 Feb  7  2017 THIRD_PARTY_README
[root@Redhat6 java]# cd bin
[root@Redhat6 java]# pwd
/usr/lib/jvm/java
[root@Redhat6 bin]# ls
appletviewer  javac         jdb         jstack        policytool   tnameserv
apt           javadoc       jhat        jstat         rmic         unpack200
extcheck      javah         jinfo       jstatd        rmid         wsgen
idlj          javap         jmap        keytool       rmiregistry  wsimport
jar           java-rmi.cgi  jps         native2ascii  schemagen    xjc
jarsigner     jcmd          jrunscript  orbd          serialver
java          jconsole      jsadebugd   pack200       servertool
[root@Redhat6 bin]#

一步一步就能找到java文件的安装路径,然后再去配置一下java_home的环境变量就可以了

请支持原创,认准DannisTang([email protected]

[LINUX]CentOS7查看Java文件安装路径_第1张图片

你可能感兴趣的:(LINUX)