'Can someone help me how to set the classpath for maven on windows 7

I am trying to set the class path on win 7 and after doing all the necessary variables when I try to execute mvn --version I am getting this error -"mvn is not recognized" In system variable I have set M2_HOME and the value is set to --- C:\Users\Amzi\Desktop\apache-maven-3.0.4-bin in to the path variable at the end I have set the value like ;C:\Users\Amzi\Desktop\apache-maven-3.0.4-bin\bin can someone help me what I am doing wrong here. Thanks



Solution 1:[1]

To run maven from command line in Windows 7 you should have properly set JAVA_HOME, M2_HOME & PATH environment variables in the following table:

    Start button -> Computer menu item -> Properties on right click menu item -> 
Advanced System Settings button on left panel -> Advanced tab in System Properties dialog ->
 Environment Variables button -> System variables table

JAVA_HOME set to directory where JDK is installed:

C:\Program Files\Java\jdk1.7.0_06

M2_HOME set to extraction directory of Maven distribution:

C:\Program Files\Maven\apache-maven-3.0.4

Additional entries in PATH for JDK and Maven binaries:

%JAVA_HOME%\bin;%M2_HOME%\bin;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andriy Plokhotnyuk