How to install Maven on windows

1

Following this tutorial link

Download maven from link

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 mvn

command

edit: 1

The bin directory contains:

edit: 2

for the creation of the variables for maven, create variable with its values, in this way:

I followed the steps of @Voiser

  

reboot the machine, now this error comes out Could not find or load main   class org.codehaus.plexus.classworlds.launcher.Launcher

edit 3: The variables in 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

    
asked by x-rw 25.04.2017 в 16:17
source

1 answer

3

Install Maven:

  • 1.-Download binaries in zip.
  • 2.- Place the zip in a desired directory, for example in the root "C: \", leaving the complete path: C: \ apache-maven-3.2.2.zip
  • 3.- Unzip zip with winrar or 7zip for example.
  • 4.- To decompress the binaries, a folder C: \ apache-maven-3.2.2 will be created, within that directory are the maven binaries.
  • Once placed and decompressed maven, create the environment variables.

    Pre-requisites: Java environment variables

    JAVA_HOME C:\Program Files\Java\jdk1. 7.0_17.
    

    Variables for maven:

      

    M2 =% M2_HOME% \ bin

         

    M2_HOME = C: \ apache-maven-3.2.2

         

    Path ...; C: \ apache-maven-3.2.2 \ bin; ...

    My suggestion is to reboot the pc to the end of creating the environment variables.

    When restarting, open a CMD console and type the following:

      

    mvn -version

    If everything is OK, you will see a message:

      

    C: \ Users \ xxx> mvn - Apache Maven version 3.2.2   (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T08: 51: 42-05: 00)   Maven home: C: \ apache-maven-3.2.2 Java version: 1.6.0_35, vendor: Sun   Microsystems Inc. Java home: C: \ Program Files \ Java \ jdk1.6.0_35 \ jre   Default locale: en_MX, platform encoding: Cp1252 OS name: "windows 7",   version: "6.1", arch: "amd64", family: "windows" C: \ Users \ xxx >

    This output is with the version: apache-maven-3.2.2

        
    answered by 25.04.2017 / 16:34
    source