Javac and java pointing to different environments

前端 未结 5 2047
名媛妹妹
名媛妹妹 2021-02-08 02:15

Please Help, I am trying to run a compiled java class and getting errors but when I try to check my java environments it points different ways as seen below

c:\\         


        
5条回答
  •  伪装坚强ぢ
    2021-02-08 02:52

    You have the jre/bin directory on the system path before the jdk/bin. The javac command doesn't exist in the jre installation.

    Thus the java command gets the version under jre6 but javac gets the version under jdk1.7.0.

    You should change your system path to only include the one you want. If you want to explicitly use one over the other use the absolute name (including path) instead of just the executable name.

提交回复
热议问题