'mvn' is not recognized as an internal or external command, operable program or batch file
My problem solved, path
didn't resolve %M2%
. When i added location of maven-bin in the path instead of %M2%
after that commands works.
I would like to thanks to all those who try to solve the problem
maven should be on the system's PATH if you wish to execute it from any place. add %M2_HOME%\bin to the PATH
First of all make sure you java is working or not run this command in cmd
C:\>java -version
if it's working it will show this output:-
C:\>java -version
java version "1.8.0_74"
Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
Java HotSpot(TM) Client VM (build 25.74-b02, mixed mode)
step 1. First set your java_home[C:\Program Files\Java\jdk1.8.0_74] path in user variable.
step 2. Then set MAVEN_HOME[C:\Program Files\maven\apache-maven-3.3.9] path in system variable and make sure your maven folder should be present in C folder only.
step 3. Then set M2 path in system variable and give maven bin location there i.e.[C:\Program Files\maven\apache-maven-3.3.9\bin].
Step 4. Then set new system variable i.e. variable name = MAVEN_OPTS in and variable value =-Xms256m -Xmx512m
Step 5. Then edit path/system path variable be care full don't remove anything from there simply add java_home path i.e=;C:\Program Files\Java\jdk1.8.0_74 and M2 variable=;%M2% in the end.
Step 6. To make sure maven is now working or not run this command in cmd
> C:\>mvn --version
if it's working it will show this result :-
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-
7+05:30)
Maven home: C:\Program Files\maven\apache-maven-3.3.9\bin\..
Java version: 1.8.0_74, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_74\jre
Default locale: en_IN, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "dos"