javac 在 Windows 7 中不被识别为内部或外部命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32155113/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
javac is not recognized as an internal or external command in windows 7
提问by Simran Kaur
I have set JAVA_HOME and PATH variable.
我已经设置了 JAVA_HOME 和 PATH 变量。
JAVA_HOME looks like this:
JAVA_HOME 看起来像这样:
C:\Program Files\Java\jdk1.8.0_60
PATH looks like this:
PATH 看起来像这样:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
"C:\Program Files\nodejs\" "C:\Program Files (x86)\Brackets\command";C:\mongodb\bin;"C:\Program Files\cURL\bin" ;C:\Python34\python.exe;
"%JAVA_HOME%/bin" ;
Yet it can not find any of the java commands like javac or java,
但是它找不到任何 java 命令,如 javac 或 java,
User Path variable:
用户路径变量:
C:\Program Files\nodejs\node_modules\npm\; C:\Users\dev4\AppData\Roaming\npm; C:\mongodb\bin; " %JAVA_HOME%\bin\" ; "%ANT_HOME%\bin\" ;
System path variable:
系统路径变量:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\; C:\Program Files\nodejs\ ; C:\Program Files (x86)\Brackets\command;C:\mongodb\bin;C:\Program Files\cURL\bin ;C:\Python34\python.exe; %JAVA_HOME%\bin\;
Despite npm command is not working either.
尽管 npm 命令也不起作用。
These have been working before but since I was trying to set path for java , al of them have stopped working
这些以前一直在工作,但是自从我尝试为 java 设置路径以来,它们都已停止工作
回答by Subodh Joshi
Please use \
backslashnot /
forward slashThat is the issue in your Path setup
请使用\
反斜杠而不是/
正斜杠这是路径设置中的问题
EDIT :-
编辑 :-
- Right-click the My Computer icon on your desktop and select Properties.
- Click Advanced system settings link.
- Click the Advanced tab.
- Click the Environment Variables button.
- Under System Variables, click New.
- Enter the variable name as
JAVA_HOME
Enter the variable value as the installation path for the Java Development Kit asC:\Program Files\Java\jdk1.8.0_60
- Now make entry for
Path
variable shown above image
- 右键单击桌面上的“我的电脑”图标,然后选择“属性”。
- 单击高级系统设置链接。
- 单击高级选项卡。
- 单击环境变量按钮。
- 在系统变量下,单击新建。
- 输入变量名作为
JAVA_HOME
输入变量值作为Java开发工具包的安装路径作为C:\Program Files\Java\jdk1.8.0_60
- 现在输入上
Path
图所示的变量
回答by ji2495
In my system, User variable path is as below
在我的系统中,用户变量路径如下
C:\apache-ant-1.9.5\bin;E:\Android\platform-tools;E:\Android\tools;C:\Users\M\AppData\Roaming\npm
C:\apache-ant-1.9.5\bin;E:\Android\platform-tools;E:\Android\tools;C:\Users\M\AppData\Roaming\npm
And my system path variable is
我的系统路径变量是
C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_45\bin;C:\Program Files\nodejs\
C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_45\bin;C:\Program Files\nodejs\
JAVA_HOME is
JAVA_HOME 是
C:\Program Files\Java\jdk1.8.0_45
C:\Program Files\Java\jdk1.8.0_45
Hope this helps.
希望这可以帮助。
回答by Kyrei
Don't do what I did and sit there wondering for an hour why the path isn't changing in your windows.
不要像我做的那样坐在那里想一个小时为什么你的窗户里的路径没有改变。
Change the Variable...
改变变量...
THEN RESTART YOUR PC
然后重启你的电脑
An hour I will never get back lost to not doing the first thing you should try.
一个小时我永远不会因为没有做你应该尝试的第一件事而迷失方向。