I am currently seeing a weird problem in Windows 8 installed on my laptop. I have copied "apache maven" to the C:\Program Files\Apache Software Foundation folder. I have set the JAVA_HOME, M2_HOME environment variables as per instructions and added the Maven bin folder to the path.

C:\Users\vikram>echo %M2_HOME%C:\Program Files\Apache Software Foundation\apache-maven-2.2.1C:\Users\vikram>echo %PATH%C:\Program Files\Apache Software Foundation\apache-maven-2.2.1\bin;C:\Perl64\site\bin;C:\Perl64\bin;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\SlikSvn\bin;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Java\jdk1.7.0_15\bin;C:\Program Files\Apache Software Foundation\apache-ant-1.8.4\bin

But when I try to access "mvn" at the command prompt, it gives me the error as follows:

C:\Users\vikram>mvn

'mvn' is not recognized as an internal or external command, operableprogram or batch file.

The only thing that I did differently is installed cygwin recently. From cygwin, I am able to access the "mvn" bin

vikram@olympus ~$ mvn --versioncygwin warning:MS-DOS style path detected: C:\Program Files\Apache Software Foundation\apache-maven-2.2.1/boot/Preferred POSIX equivalent is: /cygdrive/c/Program Files/Apache Software Foundation/apache-maven-2.2.1/boot/CYGWIN environment variable option "nodosfilewarning" turns off this warning.Consult the user's guide for more details about POSIX paths:http://cygwin.com/cygwin-ug-net/using.html#using-pathnamesApache Maven 2.2.1 (r801777; 2009-08-06 12:16:01-0700)Java version: 1.7.0_15Java home: C:\Program Files\Java\jdk1.7.0_15\jreDefault locale: en_US, platform encoding: Cp1252OS name: "windows 8" version: "6.2" arch: "amd64" Family: "windows"

Why am I not able to access the "mvn" binary from the Windows command prompt?

migrated from stackoverflow.com Mar 3 '13 at 9:08

This question came from our site for professional and enthusiast programmers.

  • Gawd, I hate Intel software.– Hans PassantFeb 27 '13 at 23:44

I used Rapid Environment Editor, started as an Administrator, and put these variables into my System path, and this problem went away.

For some reason, when I added the the JDK, JRE, and Maven bin folders to my Path through the Windows utility, it didn't work. Rapid Environment Editor told me that the variables were not valid or I did not have access to them. Windows 8 seems to be really picky about administrator rights and I guess they didn't think that through very well.

Just be sure to start Rapid Environment Editor as an administrator, and re-open your command windows when you save your changes.

    Your Answer

     
    discard

    By posting your answer, you agree to the privacy policy and terms of service.