Solution of JDK version unchanged after JAVA_HOME path modification

  • 2021-07-18 07:52:17
  • OfStack

Today, when reconfiguring Java, there was one problem. Let's mainly talk about one of our own solutions:

Problem description:

Today, I want to change the version of JDK under 1, and use it after finding the change java -version Command, the JDK version appears without transformation.

Find the reason:

There may be in the system directory java.exe Causing a priority call to java. exe in the system directory; Newly installed jdk Automatically increased path Content, java. exe exists under the added content (pointing to the path), and the order of this path in path content is ahead of the path you configured java yourself (the author's pit is here).

Solution:

Will %JAVA_HOME%/bin Put this sentence in PATH The front of the environment variable. And can produce the desired results. You can open command-line tools java -version Check the JDK version and find that it has been updated.

This is the end of OK.

Summarize


Related articles: