[英]javac not recognized as an internal or external command
What are the path variable supposed to be to ensure "javac" will work? 确保“ javac”正常工作的路径变量应该是什么? Should it be in both system and user variables and should the "\\bin" part be included? 是否应同时包含在系统变量和用户变量中,并且应包括“ \\ bin”部分吗?
I have a Program Files and Program Files(x86) and the JDK is in both. 我有一个Program Files和Program Files(x86),而JDK都在其中。 Which one should i use? 我应该使用哪一个? Eclipse is working perfectly, it's only when using command line that I get this. Eclipse运行良好,只有在使用命令行时我才知道。 Anyone? 任何人?
Eclipse comes with its own Java compiler, it doesn't have to use an external one. Eclipse带有自己的 Java编译器,而不必使用外部编译器。
You should find the bin
directory under whichever JDK you want to use and then add it to the path (I prefer the user path but, since I only ever run as one user, I'm not sure what the difference is). 您应该在要使用的JDK下找到bin
目录,然后将其添加到路径中(我更喜欢使用用户路径,但是由于我只以一个用户身份运行,因此不确定有什么区别)。
And make sure it's the JDK, not just the JRE. 并确保它是JDK,而不仅仅是JRE。
For example, mine is in c:\\program files\\java\\jdk1.6.0_17\\bin
(32-bit WinXP). 例如,我的c:\\program files\\java\\jdk1.6.0_17\\bin
位于c:\\program files\\java\\jdk1.6.0_17\\bin
(32位WinXP)中。
One final thing, if you're changing the environment variables in the control panel, that won't affect cmd
windows that are already open. 最后一件事,如果要在控制面板中更改环境变量,则不会影响已经打开的cmd
窗口。 You'll need to open up a new one to get the new environment settings (trap for wary players). 您需要打开一个新的环境来获取新的环境设置(陷阱供谨慎的玩家使用)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.