Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing maven on windows 7 64bit

I want to create a Tapestry Skeletion Project. I follow to these guide: http://maven.apache.org/download.html#Installation, http://juanjoefe.com/tutoriales/instalar-maven-en-windows-7/ and other guides on the internet.

But, when I type "mvn --version" or "mvn -version", I always receive error "mvn is not recognized as an internal or external command, operable program or batch file.

My friends use Windows 7 x86, and they had no problem. How can I install Maven 3.0.3 on Windows 7 x64?

like image 614
Gia Duong Duc Minh Avatar asked Aug 28 '11 07:08

Gia Duong Duc Minh


People also ask

Can Maven be installed on Windows?

You can download and install maven on windows, linux and MAC OS platforms. Here, we are going to learn how to install maven on windows OS. To install maven on windows, you need to perform following steps: Download maven and extract it.

How do I install an older version of Maven?

Visit the Maven download page and select the version of Maven you want to install. The latest version is listed in the Files section, and you can access earlier versions by using the archive link in the Previous Releases section. We are using version 3.8.


3 Answers

  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

like image 171
thejartender Avatar answered Oct 04 '22 13:10

thejartender


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"
like image 37
Arun Chandrasekaran Avatar answered Oct 04 '22 13:10

Arun Chandrasekaran


I had the same issue but was able to fix it.

When I set up maven_home, I had a semi-colon ; at the end. So when I set up path it become MAVEN;\bin .... I removed the semi-colon ; at the end and problem solved.

For some reason the ; does not matter in Windows XP, but is a problem in Windows7 (32 bit).

Nathan

like image 37
nathan vo Avatar answered Oct 04 '22 15:10

nathan vo