Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does linux view the jdk installation path

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "how to check the jdk installation path for linux". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to view the jdk installation path by linux"!

Linux view the jdk installation path: 1, use the "echo $JAVA_HOME" command, you can get the jdk path of the environment variable "$JAVA_HOME" configuration; 2, use the "rpm-qa | grep java" command to view the jdk installation path by getting the path of the installation package.

The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

Linux View jdk installation path

Method 1: use echo $JAVA_HOME

If you use $JAVA_HOME, you can locate the installation path of JDK only if the environment variable $JAVA_HOME is configured, otherwise, as shown below, you cannot locate the installation path of JDK at all.

[root@localhost ~] # java-versionjava version "1.7.0y65" 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 ~] # echo $JAVA_HOME

Method 2: use rpm-qa | grep java

This method will not work if JDK is installed in source code. In other words, rpm-ql packagename also has some limitations.

[root@localhost ~] # rpm-qa | grep javatzdata-java-2014g-1.el6.noarchjava-1.6.0-openjdk-1.6.0.0-11.1.13.4.el6.x86_64java-1.7.0-openjdk-1.7.0.65-2.5.1.2.el6_5.x86_64 [root@localhost ~] # rpm-ql java-1.7.0-openjdk-1.7.0.65-2.5.1.2 .el6 _ 5.x86_64 | more/etc/.java/etc/.java/.systemPrefs/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jaas-1.7.0.65.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0. 65.x86 "64" JaasMuil 1.7.0.jarUniverse usrexportsexportsexportsMakejava exports1.7.7.0.65.x86 "64" jaas.jarUniverexportsUniverse javaMoe 1.7.0.6x86 "64" jvmexportsUniverse javaMoe 1.7.0.65.x86 "64jceear 1.7.0.65.jarGexportsUniverse libUniverse 1.7.0music openjdkcolor 1.7.0.65.x866c 64/jce-1.7.0.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jce.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jdbc-stdext-1.7.0.65.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/ Jdbc-stdext-1.7.0.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jdbc-stdext-3.0.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jdbc-stdext.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jndi- 1.7.0.65.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jndi-1.7.0.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jndi-cos-1.7.0.65.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65. X86_64/jndi-cos-1.7.0.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jndi-cos.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jndi-ldap-1.7.0.65.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0. 65.x86_64/jndi-ldap-1.7.0.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jndi-ldap.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jndi-rmi-1.7.0.65.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7. 0.65.x86_64/jndi-rmi-1.7.0.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jndi-rmi.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jndi.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/ Jsse-1.7.0.65.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jsse-1.7.0.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/jsse.jar/usr/lib/jvm-exports/java-1.7.0-openjdk-1.7.0.65.x86_64/sasl-1. 7.0.65.jarAccord libUniverse 1.0.65.x86ExportsUniverse java 1.7.0.jarUniverse libkame1.0.65.x86xx6x6xx6xx6xx6xx6xx6x6xx6xx6xx6x6xx6xx6x6xxx6xxx6xxx6xxx6xxx6xx86xx86xx86xx86xx86xx86xx86xx86xx86xx6xxx6xxx6xxxxxx6xxx6xxx6xxx6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6xxx6xxxxx6xxxxxx6xxxxxx6xxxx6 Openjdk.x86_64/usr/lib/jvm-private/java-1.7.0-openjdk.x86_64/jce/usr/lib/jvm-private/java-1.7.0-openjdk.x86_64/jce/vanilla/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/ASSEMBLY_EXCEPTION/usr/lib/ Jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/LICENSE/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/THIRD_PARTY_README/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/ Bin/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/java/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/keytool/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/orbd/usr/lib/jvm/java-1.7.0-openjdk- 1.7.0.65.x86x64Universe 64Universe 1.7.0.65.x86xx61x61x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x86xx86xx6x86xxx86xx6x6xxx86xxx86xx6x6xxxx86xxxx86xxx6x6xxx6x6xxxx6x6xxxx6xxxxx6x6xxxxx6x6xxxxxx6x6xxxxxx6x6xxxxx6x6xxxx6x6xxx6x6xxx6xx6xxx6x6xxx6xx6xxx6xx6xx6xxx6x6xxxx6x6xxx6x6xxx6x6xxxx6x6x6xxx6x6xxx6x6xxxx6x6xx6x6

Expand knowledge:

Check the java version number-use java-version

[root@localhost] # java-versionjava version "1.7.0y65" 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)

View the execution path of jdk-- use which java

Which java locates to the execution path of the java program. The information on the Internet is like what others say and doesn't think about it at all. So how do you navigate to the installation path of java? Let's take a look at the example, as shown below:

[root@localhost] # which java/usr/bin/java [root@localhost] # ls-lrt / usr/bin/javalrwxrwxrwx. 1 root root 22 Aug 17 15:12 / usr/bin/java-> / etc/alternatives/java [root@localhost ~] # ls-lrt / etc/alternatives/javalrwxrwxrwx. 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] # lsjava-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] #

The same is true of whereis java, which itself cannot navigate to the installation path. You can use the above example to locate the installation path

At this point, I believe you have a deeper understanding of "how linux views the jdk installation path". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report