javac not found after set environment variable

好久不见. 提交于 2019-12-12 01:04:34

问题


I am running on a windows 7 machine.

I installed java jdk 1.7.

I have set the Path and PATH environment variable to point to the java jdk 1.7/bin directory.

executing java -version in the command prompt yields java version 1.7.0_45 ...

however when I execute javac it says that javac is not recognized as an internal or external command ...

I am really stumped on this problem. I really want to get this resolved ASAP. If anyone has experienced similar issues can you please share.

All other threads seem to get similar issues resolved via changing the environment variable but this is not solving my problem in this situation.

EDIT: when I run java -version in Console2 it says that the currently used version of java is 1.6 and I am not sure why this is the case.


回答1:


Not sure if this is the cause, but in the path you posted

C:\Program Files\Java\jdk1.7.0_45 \bin

Looks like an extra space in between of "jdk1.7.0_45" and "\bin"

Also it's always good to append ";" at the end.

PATH = C:\Program Files\Java\jdk1.7.0_45\bin;




回答2:


Chnage it to C:\Progra~1\Java\jdk1.7.0_45\bin and it shall work like magic :)



来源:https://stackoverflow.com/questions/20738264/javac-not-found-after-set-environment-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!