Results 1 to 10 of 10
- 12-04-2011, 10:53 AM #1
Member
- Join Date
- Mar 2011
- Posts
- 44
- Rep Power
- 0
Maven: 'cmd' is not recognised as an internal or external command
Hi all,
I've been playing with Maven and a strange issue has appeared.
I'm using Windows Vista 32 bit.
Below are the steps I went through to setup Java and Maven (Please note I previously setup Maven 3.0.3 - and had the same problem-so removed it and decided to try maven 2.2.1)
1. I installed java 1.6.0_29 to: C:\Program Files\Java\jdk1.6.0_29
2. I installed maven 2.2.1 to: C:\apache-maven-2.2.1
3. I created a JAVA_HOME environment variable to: C:\Program Files\Java\jdk1.6.0_29
4. I created a M2 environment variable to: %M2_HOME%\bin
5. I created a M2_HOME environment variable to: C:\apache-maven-2.2.1
6. I updated my Path system variable with: C:\apache-maven-2.2.1\bin;C:\Program Files\Java\jdk1.6.0_29\bin
I use Netbeans 7.0.1
now, the problem is, when I attempt to build an app in Netbeans it builds without errors (Build successful) but the last line reads: 'cmd' is not recognized as an internal or external command, operable program or batch file.
The same occurs in Netbeans when I run the app, but the application fails to open (its a webapp).
When I try to run the app using DOS and mvn package, etc. I still get the same message.
Anyone have any ideas what is going on? Its driving me nuts.
Cheers
Al
- 12-04-2011, 01:25 PM #2
Re: Maven: 'cmd' is not recognised as an internal or external command
Can you copy and paste here the full text from when you try to execute the program in a command prompt?
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'
Paste here.
- 12-10-2011, 06:51 AM #3
Member
- Join Date
- Mar 2011
- Posts
- 44
- Rep Power
- 0
Re: Maven: 'cmd' is not recognised as an internal or external command
Ok, when I type: javac -version, the following appears:
C:\Als Stuff\myjavasource\mavenproject1>javac -version
javac 1.6.0_29
C:\Als Stuff\myjavasource\mavenproject1>
Next when I type mvn --version the following happens:
C:\Als Stuff\myjavasource\mavenproject1>mvn --version
Apache Maven 2.2.1 (r801777; 2009-08-07 05:16:01+1000)
Java version: 1.6.0_29
Java home: C:\Program Files\Java\jdk1.6.0_29\jre
Default locale: en_AU, platform encoding: Cp1252
OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows"
'cmd' is not recognized as an internal or external command,
operable program or batch file.
C:\Als Stuff\myjavasource\mavenproject1>
So as you can see, the 'cmd' is not recognised.... doesnt happen when I run the java version. Anyone have any ideas?
This is happening on both my laptop and my desktop PC at home. but at least the Desktop PC still runs the application, while the laptop just builds the app and does nothing else (doesnt open the browser).
- 12-10-2011, 01:16 PM #4
Member
- Join Date
- Dec 2011
- Posts
- 1
- Rep Power
- 0
Re: Maven: 'cmd' is not recognised as an internal or external command
Add C:\Windows\System32 to your Path variable in environment variables and it should work.
- 12-11-2011, 01:19 AM #5
Member
- Join Date
- Mar 2011
- Posts
- 44
- Rep Power
- 0
Re: Maven: 'cmd' is not recognised as an internal or external command
Thanks AvalanceBoy,
Ill give that a go when I am back home.
Cheers
Al
- 12-11-2011, 01:58 AM #6
Member
- Join Date
- Mar 2011
- Posts
- 44
- Rep Power
- 0
Re: Maven: 'cmd' is not recognised as an internal or external command
Ok, I've had a look and below is a copy/paste of my path variables (Ive formatted it to make it easier to read):
Java Code:/%SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem; C:\Program Files\CyberLink\Power2Go; C:\Program Files\ATI Technologies\ATI.ACE\Core-Static; %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\; C:\Program Files\MySQL\MySQL Server 5.5\bin; C:\apache-maven-2.2.1\bin; C:\Program Files\Java\jdk1.6.0_29\bin
Last edited by sibernewf; 12-11-2011 at 02:03 AM.
- 12-11-2011, 02:36 AM #7
Member
- Join Date
- Mar 2011
- Posts
- 44
- Rep Power
- 0
Re: Maven: 'cmd' is not recognised as an internal or external command
It appears I only get the:
'cmd' is not recognized as an internal or external command,
operable program or batch file.
when running mvn commands. Any other MSDOS command doesnt reproduce it. So I suspect its related only to Maven.
- 12-20-2011, 05:05 AM #8
Member
- Join Date
- Mar 2011
- Posts
- 44
- Rep Power
- 0
Re: Maven: 'cmd' is not recognised as an internal or external command
Ok, I finally gave up and re-installed my Operating System on the laptop.
The problem has gone away. But I have no idea what happened in the first place.
Cheers
- 03-11-2012, 02:09 PM #9
Member
- Join Date
- Mar 2012
- Posts
- 15
- Rep Power
- 0
- 06-27-2012, 09:31 AM #10
Member
- Join Date
- Jun 2012
- Posts
- 1
- Rep Power
- 0
Re: Maven: 'cmd' is not recognised as an internal or external command
It happened to me also, but I managed to reedit the environment path of my computer to what it was before after adding the ANT and JAVA paths. hope it will fix your's also as the problem occurs because of the fact that CMD couldn't get to the system root.
Similar Threads
-
Java is not recognized as an internal or external command
By david1995 in forum New To JavaReplies: 12Last Post: 11-25-2010, 06:55 AM -
Java is not recognized as an internal or external command.
By Java Skills in forum New To JavaReplies: 6Last Post: 09-13-2010, 11:13 PM -
C:\Program is not recognized as an internal or external command...
By HughTh in forum NetBeansReplies: 5Last Post: 04-26-2010, 04:45 AM -
'javac' is not recognized as an internal or external command
By sam_1032002@btopenworld.c in forum New To JavaReplies: 3Last Post: 10-18-2008, 02:40 AM -
'cmd' is not recognized as an internal or external command
By thelukestir in forum New To JavaReplies: 6Last Post: 07-30-2008, 03:50 AM


LinkBack URL
About LinkBacks


Bookmarks