Following this tutorial https://www.tutorialspoint.com/maven/maven_environment_setup.htm
Download maven from http://maven.apache.org/download.cgi
I am adding these variables: in the system path.
M2_HOME:
C:\programs\apache-maven-3.0.3
M2:
%M2_HOME%\bin
JAVA_HOME:
C:\Program Files\Java\jdk1.6.0_25
Path:
%JAVA_HOME%\bin; %M2%
does not recognize the commandmvn
edit: 1
edit: 2
for the creation of the variables for maven, create a variable with its values, in this way:
I followed the steps of @Voiser
restart the machine, now I get this error Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher
edit 3: the variables on my system are:
C:\Users\DH-User15>echo %M2_HOME% %M2_HOME%
C:\Users\DH-User15>echo %M3_HOME% C:\apache-maven-3.5.0
C:\Users\DH-User15>echo %M2% C:\apache-maven-3.5.0\bin
C:\Users\DH-User15>echo %path% ... C:\apache-maven-3.5.0\apache-maven\src\bin
Install Maven:
Once placed and unzipped maven, create the environment variables.
Prerequisites: java environment variables
Variables for maven:
My suggestion is to restart the pc when I finish creating the environment variables.
Upon reboot, open a CMD console and type the following:
If everything is OK, you will see a message:
This output is with version: apache-maven-3.2.2
I INSTALLED MAVEN ON WINDOWS 10
After installation I got the message: " Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher "
I just followed the instructions on the page: https://maven.apache.org/install.html I didn't require "M2", "M2_HOME", "M3", "M3_HOME" or any other.
1.- I downloaded the Binary zip archive from the page: https://maven.apache.org/download.cgi#Installation I unzipped it in **C:\apache-maven-3.6.1**
2.- I checked my " JAVA_HOME " ( Environment Variables - User Variables for... ) that had the path of my JDK " C:\Program Files\Java\jdk1.8.0_171 "
3.- I verified (added) my "Path" " C:\apache-maven-3.6.1 " as it is written ( I did not put a forward slash at the end ).
4.- I checked the MAVEN version with " mvn -v " and it gave me the correct information.
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T13:00:29-06:00) Maven home: C:\apache-maven-3.6.1\bin.. Java version: 1.8.0_171, vendor: Oracle Corporation , runtime: C:\Program Files\Java\jdk1.8.0_171\jre Default locale: es_MX, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows "
and ready!
There is a "space" you need to remove, change this
%JAVA_HOME%\bin; %M2%
to this%JAVA_HOME%\bin;%M2%