Home  >  Q&A  >  body text

java -version 和 java_home 不一样

PHP中文网PHP中文网2741 days ago348

reply all(3)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 09:17:52

    java -version is the command line statement of java. JAVA_HOME is the java environment path

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 09:17:52

    What you need to look at is not java_home but the directory of /bin/java that appears first in the path variable
    Understand the search order

    1. First search from the current directory

    2. If you can’t find it, search it from the directory in the current path variable. If you find it, call and return

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-18 09:17:52

    1.JAVA_HOME is the path to the jdk that you set in path. echo %java_home% 就是打印 jdk所在路径.
    2.java -version is the version of java that is printed, which is the command line statement of java.

    reply
    0
  • Cancelreply