6

Maven seems to be installed on my workstation. I do not know Maven, but am trying to learn it. It looks like Maven uses (on Windows 7) the location C:\Users\User\.m2\repository. I have this location.

But when I try mvn --version I get nothing.

I have jdk, eclipse, jboss, jboss developer studio installed.

Is maven included in eclipse or jboss developer studio?

I can create a new maven project with jboss developer studio.

But I cannot follow the tutorials because they teach command line usage, and that does not work on my system.

Is Maven installed? Then, where is it, so I can add it to the path ( a search for 'maven' on the whole disk did not help me).

Adrian 3873
  • 127
  • 1
  • 1
  • 8
  • possible duplicate of [Installing maven on windows 7 64bit](http://stackoverflow.com/questions/7219628/installing-maven-on-windows-7-64bit) – Joe Nov 05 '14 at 10:41
  • not a duplicate; i searched the entore pc for mvn.exe and no result – Adrian 3873 Nov 05 '14 at 12:07
  • 1
    That question also points to the installation instructions ([Installation Instructions](http://maven.apache.org/download.cgi#Installation)) which will help. – Joe Nov 05 '14 at 12:09

4 Answers4

6

There is no default installation location for maven. It is distributed as a zip file. If you're sure you have maven on your machine, you need to search where you extracted it. You should search for "mvn.bat" and add the containing folder to your PATH environment variable. If you can't find it, it wouldn't hurt to download it again and extract the zip anywhere on your computer. As far as "C:\Users\User.m2\repository" is concerned. That is where maven keeps the project dependencies. You will not find the binaries there.

Also, I don't think maven comes packaged with eclipse.

Furqan Shakoor
  • 143
  • 1
  • 9
  • 1
    Thanks. I don't have enough reputation to upvote though. Your answer told me two things: to search for mvn.bat instead of mvn.exe (which I should have figured it out myself by downloading maven and looking how it looks unzipped); and that I can re-install maven no worries. I found it with the code for jboss app server (...\jboss-as-7.1.1.Final\jboss-as-7.1.1.Final\tools\maven). – Adrian 3873 Nov 05 '14 at 12:40
2

Eclipse have Maven embedded.

In order to use the mvn command, you have to download maven in your computer.

After install maven, verify if you have the environment variable in your system. To do so, open terminal and type: set to print all configured environment variables.

If you do not have the MAVEN_HOME environment variable defined (for example, MAVEN_HOME=C:\<maven path>\apache-maven-3.6.3) you have to create it (the value needs to be the folder where you installed Maven). In addition, the bin folder in Maven's folder needs to be part of your PATH. Follow this link to set the variable: https://superuser.com/questions/79612/setting-and-getting-windows-environment-variables-from-the-command-prompt

If you would like that Eclipse uses your Maven installation, redirect it in Eclipse config:

  1. Window --> Preferences --> Maven --> Installations
  2. Click Add.
  3. Click in Directory and point to maven directory installed, for example: c:\<Maven path>\apache-maven-3.6.3.
  4. click Finish and select the your maven in the checkbox Apply and Close.
Itaypk
  • 1,103
  • 10
  • 25
1

On Windows in cmd the command 'mnv -v' rolls out its location.

Khamaseen
  • 326
  • 3
  • 9
0

If you are using Eclipse you will find the maven files in your eclipse folder.

Example: C:\Program Files\IDE\Eclipse\eclipse luna\eclipse\plugins

Packages starting with org.eclipse.m2e.* are maven files. Don't remove/change them using your explorer :)

alex
  • 8,904
  • 6
  • 49
  • 75