install Maven on windows

As we discussed in previous tutorials that Apache maven is Java based project management tool so JDK is the first requirement. Let us discuss step by step maven installation on windows.

Install maven on windows:

  1. Check Java installation on your machine. Use c:\> java –version command to verify the java installation. Install the java software development kit if it is not installed.

  2. Add JAVA_HOME environment variable if it is not added. Right click on MyComputer -> properties -> Advanced System Settings -> Environment variables -> click new button. Add JAVA_HOME in variable name and java path (like C:\Program Files\Java\jdk1.7.0_60) in variable value. Now append the java compiler location up to bin folder (C:\Program Files\Java\jdk1.7.0.60\bin) to the system variable, Path.

  3. Download apache maven from here.

  4. Extract the maven archive file (like apache-maven-3.3.1-bin.zip) to the location where we want to install it. E.g. C:\Program Files\Apache Software Foundation\apache-maven-3.3.1.

  5.  Add maven environment variables. Right click on MyComputer -> properties -> Advanced System Settings -> Environment variables -> click new button. Add M2_HOME in variable name and maven path (like C:\Program Files\Apache Software Foundation\apache-maven-3.3.1) in variable value. Now append the maven bin folder (C:\Program Files\Apache Software Foundation\apache-maven-3.3.1\bin) to the system variable, Path.

  6. Verify maven installation using c:\> mvn –version command.