Home  >  Article  >  Operation and Maintenance  >  How to view the jdk installation directory in centos system

How to view the jdk installation directory in centos system

王林
王林Original
2020-03-20 11:32:214712browse

How to view the jdk installation directory in centos system

The search process when the java command can be executed is as follows:

1. Execute which java

[root@localhost ~]# which java
/usr/bin/java

(recommended tutorial: centos Tutorial)

2. Execute ls -lrt /usr/bin/java

[root@localhost ~]# ls -lrt /usr/bin/java
lrwxrwxrwx. 1 root root 22 10月 10 08:06 /usr/bin/java -> /etc/alternatives/java

3. Execute ls -lrt /etc/alternatives/java

[root@localhost ~]# ls -lrt /etc/alternatives/java
lrwxrwxrwx. 1 root root 73 10月 10 08:06 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64/jre/bin/java

It can be seen from the above that the path of java is: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64. Enter the path to view the file as follows:

[root@localhost ~]# cd /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64
[root@localhost java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64]# ll
总用量 4
drwxr-xr-x. 2 root root 4096 10月 10 14:53 bin
drwxr-xr-x. 3 root root 132 10月 10 14:53 include
drwxr-xr-x. 4 root root  28 10月 10 08:03 jre
drwxr-xr-x. 3 root root 144 10月 10 14:53 lib
drwxr-xr-x. 2 root root 204 10月 10 14:53 tapset
[root@localhost java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64]#

Related Video tutorial recommendation: linux video tutorial

The above is the detailed content of How to view the jdk installation directory in centos system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn