Windows ignores JAVA_HOME: how to set JDK as default?

前端 未结 14 2916
感动是毒
感动是毒 2020-11-27 11:30

How do I persuade Windows to use the JDK instead of a JRE?

This question has been asked before, here and elsewhere:

How do I set the default Java installatio

14条回答
  •  北荒
    北荒 (楼主)
    2020-11-27 12:04

    On Windows, the java executable uses the Windows Registry to locate the default version of Java to run.

    The copy of java.exe to run is found by using the PATH environment variable. Unless you take steps to change this, by default a copy will be found in the Windows directory. Since this copy isn't in a Java runtime directory, it locates one by looking at the registry.

    So, you either need to modify the registry, or put the version of Java you want before the Windows directory in your PATH.

提交回复
热议问题