Installing maven on windows 7 64bit

Setting up Maven 3.0.4 in Windows 7 64 bit

  • Right Click My Computer → Properties → Advanced System Properties → Environment Variables → System Variables

  • Click "New"

  • Add

M2_HOME=C:\maven\apache-maven-3.0.4
M2=%M2_HOME%\bin

Assuming JAVA_HOME is already setup.

  • Edit Path environment variable and add %M2% as ;%M2% at the end of the existing path

Example:

C:\Users\arun.bc\oraclexe\app\oracle\product\10.2.0\server\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Dell\DW WLAN Card;C:\Ruby193\bin;C:\Borland\BCC55\Bin;%JAVA_HOME%/bin;%M2%

Apply and Close the System Properties

Open a new command prompt and type

mvn --version

The following message should be displayed:

C:\Users\arun.bc>mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 16:44:56+0800)
Maven home: C:\maven\apache-maven-3.0.4
Java version: 1.7.0_03, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_03\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

  1. navigate to the Maven directory (e.g. in your explorer)
  2. go to a dir IN the bin
  3. copy the address in the address bar (F4 or CTRL+L, must end with bin)
  4. go to Start and type in env
  5. Select "edit the system evironment variables"
  6. find the PATH variable which must also have an existing value for Java as Maven needs Java.
  7. append a ; + paste the previously copied path.
  8. restart to update system
  9. run mvn install in the cli.

Yucca