'cmd' is not recognized as an internal or

2020-02-07 03:54发布

When I build my project in netbeans me it shows:

'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:

%SystemRoot%\system32;%SystemRoot%;D:\POS\apache-maven-3.3.3-bin\apache-maven-3.3.3\bin;

4条回答
smile是对你的礼貌
2楼-- · 2020-02-07 04:08

We can get cmd.exe with already setted System root path in very simple way

  1. simply copy cmd.exe from Windows/System32 folder and paste it in directory where it is needed.
查看更多
再贱就再见
3楼-- · 2020-02-07 04:10

you can get it worked in anyone of below ways

  1. Set path to system32 c:\windows\system32 instead of %SystemRoot%\system32
  2. Go to system32 folder then search and find cmd.exe
  3. Use command instead of cmd.exe
查看更多
在下西门庆
4楼-- · 2020-02-07 04:13

So far I understand this is not your IDE issue.Check your "system32" is correctly defined in the PATH environment variable .

Path = %SystemRoot%\system32;
查看更多
来,给爷笑一个
5楼-- · 2020-02-07 04:24

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.

SO the conclusion is you were trying to install java or maven and you replaced Path with PATH and its gone.

So set the SystemRoot path in environment variable something like below.

PATH = %JAVA_HOME%\bin;%M2_HOME%\bin;%SystemRoot%\system32;

查看更多
登录 后发表回答