java.exe always point to the path of JRE but not JDK

前端 未结 5 1490
臣服心动
臣服心动 2021-01-02 11:33

I have both jdk and jre installed on my windows 7.

I have set the JAVA_HOME to

C:\\Program Files\\Java\\jdk1.6.0_23

I have add

相关标签:
5条回答
  • 2021-01-02 12:08

    Just remove java.exe from %windir%\system32

    0 讨论(0)
  • 2021-01-02 12:10

    If you have a 64bit operating system, it will try to use the 64bit jre that is preinstalled on windows 7. You can try using add/remove programs to remove the 64bit jre. I've had this problem several times and I've always fixed it by removing the 64bit jre.

    0 讨论(0)
  • 2021-01-02 12:19

    Right click MY Computer> properties > Advanced System Settings > Environment Variables >

    Search for Path..

    Remove the exisiting path and then add yours..

    take care of the semi colon

    0 讨论(0)
  • 2021-01-02 12:24

    since you are on windows, java doesn't work like that. there is a java.exe in some windows directory (%windir% system32 for you)

    This java.exe actually looks in the registry HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment

    PATH won't help ya! Since I tend to get lazy I delete the JRE and create a junction to the JDK instead.

    0 讨论(0)
  • 2021-01-02 12:25

    make sure that your JRE/bin directory is not included in your path. the first instance of java.exe found while searching your path will be the one that is executed. if you've added your JDK to the path after the JRE then the JRE will always be picked.

    you can also explicitly specify the full path to java.exe when invoking java. this will ensure that you always know what java jre/jdk you are invoking.

    0 讨论(0)
提交回复
热议问题