How to check the jdk (java development kit) installation path

How to check the jdk (java development kit) installation path

The following uses a Windows 10 computer as an example.

If you have already installed jdk (java development kit) and configured environment variables, but you forgot where the installation path is afterwards, how do you check the jdk installation path?

Law one,

First execute the java -version command to check whether java has been configured.

If the java version is found, it proves that it has been installed and configured, and then executing the java -verbose command will return a lot of information, including the JDK installation path.

This method can only see the first one for multiple jdk installations, see the figure below:

[How to clear the content of the command line window,
enter cls and press Enter]

The following approach may be better:

Law 2,

Right-click on this computer, Properties  -> Advanced System Settings -> Environment Variables, find the path line in "User Variables" (works for the current user) or "System Variables" (works for all users on this computer), click to select it, and click "Edit" to find the part with "Java", see the picture below:

As can be seen from the figure, two versions of jdk are installed in this example .

By the way, user environment variables have higher priority than system environment variables! The system will check the user variable first, and if the variable name is found to be defined, it will be used instead of checking whether the system variable exists and what its value is. If the user variable is not defined, then go to the system variable. User variables take precedence over system variables.

Extended reading: The difference between user variables and system variables https://www.cnblogs.com/xinxianquan/p/10663756.html

Guess you like

Origin blog.csdn.net/cnds123/article/details/101539053