简体   繁体   English

javac无法识别为内部或外部命令

[英]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.

相关问题 'javac'未被识别为内部或外部命令 - 'javac' is not recognized as an internal or external command Javac无法识别为内部或外部命令 - Javac isn't recognized as internal or external command 在Windows 7中,javac不被识别为内部或外部命令 - javac is not recognized as an internal or external command in windows 7 javac无法识别为内部或外部命令 - javac isn't recognized as an internal or external command 错误 -'javac' 不是内部或外部命令,也不是可运行的程序或批处理文件 - Error -'javac' is not recognized as an internal or external command, operable program or batch file $不被识别为内部或外部命令 - $ is not recognized as an internal or external command 添加到 PATH 后,'javac' 未被识别为内部或外部命令、可运行的程序或批处理文件 - 'javac' is not recognized as an internal or external command, operable program or batch file after adding to PATH 'javac' 不是内部或外部命令,也不是可运行的程序或批处理文件。 在 VS Code 中,使用 Code Runner 扩展 - 'javac' is not recognized as an internal or external command, operable program or batch file. in VS Code, using Code Runner extension 创建jni4.jar文件时,它显示“ javac”未被识别为内部或外部命令,可操作程序或批处理文件 - When creating jni4.jar file, it shows 'javac' is not recognized as an internal or external command, operable program or batch file CMD/PowerShell: 'javac' 不是内部或外部命令,也不是可运行的程序或批处理文件 - CMD/PowerShell: 'javac' is not recognized as an internal or external command, operable program or batch file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM