Java 'cmd' 不是内部或外部命令,也不是可运行的程序或批处理文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32035577/
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
'cmd' is not recognized as an internal or external command, operable program or batch file
提问by Drashti Pandya
When I build my project in netbeans me it shows:
当我在 netbeans 中构建我的项目时,它显示:
'cmd' is not recognized as an internal or external command,
operable program or batch file.`
I'm using jdk 8 and maven 3.3. My path system variable is:
我正在使用 jdk 8 和 maven 3.3。我的路径系统变量是:
%SystemRoot%\system32;%SystemRoot%;D:\POS\apache-maven-3.3.3-bin\apache-maven-3.3.3\bin;
采纳答案by orvi
So far I understand this is not your IDEissue.Check your "system32" is correctly defined in the PATH environment variable .
到目前为止,我明白这不是您的IDE 问题。检查您的“system32”是否在 PATH 环境变量中正确定义。
Path = %SystemRoot%\system32;
回答by Sasikumar Murugesan
you can get it worked in anyone of below ways
您可以通过以下任何一种方式使其工作
- Set path to system32
c:\windows\system32
instead of%SystemRoot%\system32
- Go to system32 folder then search and find
cmd.exe
- Use
command
instead ofcmd.exe
- 将路径设置为 system32
c:\windows\system32
而不是%SystemRoot%\system32
- 转到system32文件夹然后搜索并找到
cmd.exe
- 使用
command
代替cmd.exe
回答by Arshad Ali
We can get cmd.exe with already setted System root path in very simple way
我们可以通过非常简单的方式获取已设置系统根路径的 cmd.exe
- simply copy cmd.exe from Windows/System32 folder and paste it in directory where it is needed.
- 只需从 Windows/System32 文件夹中复制 cmd.exe 并将其粘贴到需要它的目录中。
回答by Alien
One variable named Path
was already set but i created a new variable which is PATH
so it replaced the Path
variable so Path = %SystemRoot%\system32;
got deleted.
命名一个变量Path
已经确定,但我创建了一个新的变量,它是PATH
那么它取代的Path
变量,因此Path = %SystemRoot%\system32;
删除了。
SO the conclusion is you were trying to install java or maven and you replaced Path with PATH and its gone.
所以结论是你试图安装 java 或 maven,你用 PATH 替换了 Path 并且它消失了。
So set the SystemRoot path in environment variable something like below.
所以在环境变量中设置 SystemRoot 路径,如下所示。
PATH = %JAVA_HOME%\bin;%M2_HOME%\bin;%SystemRoot%\system32;
路径 = %JAVA_HOME%\bin;%M2_HOME%\bin;%SystemRoot%\system32;