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

前端 未结 5 1508
臣服心动
臣服心动 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: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.

提交回复
热议问题