You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by mailman <nm...@shaw.ca> on 2011/09/07 18:57:21 UTC

'mvn' is not recognizedas an internal or external command

I have only found this 
http://maven.40175.n5.nabble.com/Mvn-command-not-recognized-td118686.html
reference  and other similar references via Google. Tried all suggestions,
and have isolated the issue down the issue I'm having now.

I'm setting up on a Windows XP VM.

I have the Java SDK, and Mvn installed in "C:\Software" folder to eliminate
spaces in the path.
 C:\Software\Java\jdk1.7.0\bin
 C:\Software\apache-maven-3.0.3\bin

I have my environment variables set up as follows:

*USER ENV VARS*
M2 = %M2_HOME%\bin
M2_HOME = C:\Software\apache-maven-3.0.3

Based on the resources I've searched, I'm not using these in my "Path"
environment var in favor of using  literal paths to avoid misinterpretation.

*SYSTEM ENV VAR*
Path = *C:\Software\Java\jdk1.7.0\bin; C:\Software\apache-maven-3.0.3\bin*;
%SystemRoot%\system32; %SystemRoot%;%SystemRoot%\System32\Wbem; 

The problem is this:
I can execute my Java compile command as per the Maven install instructions:
java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
and get my expected "Hello World"

But I cannot execute my mvn version command:
mvn --version

But.....if I reverse the two paths to the following:
Path = *C:\Software\apache-maven-3.0.3\bin; C:\Software\Java\jdk1.7.0\bin;*
%SystemRoot%\system32; %SystemRoot%;%SystemRoot%\System32\Wbem;

I can then execute my 'mvn --version' command, but then get the same error
for Java:
'java' is not recognizedas an internal or external command

Anyone have any clue what's going on here? Thanks!

--
View this message in context: http://maven.40175.n5.nabble.com/mvn-is-not-recognizedas-an-internal-or-external-command-tp4779300p4779300.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: 'mvn' is not recognizedas an internal or external command

Posted by mailman <nm...@shaw.ca>.
It seems I have fixed the issue. If anyone see's any potential issues with
this configuration, please enlighten me.

To fix, I simply created an additional "Path" var in the USER ENV VARS
section, with the path pointing to the JAVA SDK bin folder.

*USER ENV VARS*
M2 = %M2_HOME%\bin 
M2_HOME = C:\Software\apache-maven-3.0.3 
Path = *C:\Software\Java\jdk1.7.0\bin;*   <--- Created this new var and path

I'm still not using these Maven vars in my "Path" system environment var in
favor of using literal paths to avoid misinterpretation. I tried it using
the Maven vars, but it didn't work.

*SYSTEM ENV VAR*
Path = *C:\Software\apache-maven-3.0.3\bin*; %SystemRoot%\system32;
%SystemRoot%;%SystemRoot%\System32\Wbem;

--
View this message in context: http://maven.40175.n5.nabble.com/mvn-is-not-recognizedas-an-internal-or-external-command-tp4779300p4779605.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org