I am using Netbeans 7.4. I down loaded the Maven3.1 and extracted in C:\Apache\apache-maven-3.1.1. System Variables are set as :
JAVA_HOME is set at C:\Program Files\Java\jdk1.7.0_45 M2_HOME is set to C:\Apache\apache-maven-3.1.1
Path is set to C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Java\jdk1.7.0_45\bin;%M2_HOME%\bin
Now when from the command line I command ..>mvn -v I get this this error:
ERROR: JAVA_HOME is set to an invalid directory. JAVA_HOME = "C:\Program Files\Java\jdk1.7.0_45;" Please set the JAVA_HOME variable in your environment to match the location of your Java installation
echo %JAVA_HOME%
? how did you set JAVA_HOME? It has a semicolon at the end that shouldn't be there. – JB Nizet