Windows ignores JAVA_HOME: how to set JDK as default?

前端 未结 14 2872
感动是毒
感动是毒 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:05

    After struggling with this issue for some time and researching about it, I finally managed to solve it following these steps:

    1) install jdk version 12
    2) Create new variable in systems variable
    3) Name it as JAVA_HOME and give jdk installation path
    4) add this variable in path and move it to top.
    5) go to C:\Program Files (86)\Common Files\Oracle\Java\javapath and replace java.exe and javaw.exe with the corresponding files with the same names from the pathtojavajdk/bin folder

    Finally, I checked the default version of java in cmd with "java -version" and it worked!

提交回复
热议问题