aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Unable to Get Maven Installed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Unable to Get Maven Installed" Watch "Unable to Get Maven Installed" New topic
Author

Unable to Get Maven Installed

Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 477
Hi Everyone,

I tried installing Maven yesterday. But could not get it working. I followed the instruction given on the site but it doesn't work! When i run the command, this is what comes out:


I checked the installtion process, and it was all about setting the environment variables. I did them but it didn't work. These are the environment variables that i set up:
M2 - E:\Portlet_Stuff\apache-maven-2.2.1\bin
M2_HOME - E:\Portlet_Stuff\apache-maven-2.2.1
PATH - %JAVA_HOME%\bin;E:\Portlet_Stuff\apache-maven-2.2.1\bin
I hope these are correct or am i doing something wrong here?
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

What you get when you type --> echo %M2_HOME% in command prompt?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 477


That seems to come out fine.
Srikanth Kumar
Ranch Hand

Joined: Jun 04, 2008
Posts: 36
are you able to execute mvn --version from E:\Portlet_Stuff\apache-maven-2.2.1\bin directory? If yes then include the env variable M2_HOME in the PATH variable. after this you would be able to access mvn from any other directory.


Srikanth Kumar
SCJP 5, SCWCD 5, SCDJWS 5
Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 477
Thanks Vijitha and Srikanth. That solved the problem!!
Mehdi Ben Larbi
Ranch Hand

Joined: Aug 17, 2010
Posts: 70
Hello,

I have the same problem but i can't execute mvn --version from my maven directory.
I don't know what's the problem ?


SCJP 93 % ,preparing for SCWCD
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15662
    
  15

Mehdi Ben Larbi wrote:Hello,

I have the same problem but i can't execute mvn --version from my maven directory.
I don't know what's the problem ?


If you're doing it in Linux, the current directory isn't part of the default execution path. Try "./mvn"

Better yet, set your environment:

Windows: "PATH ADD %MAVEN_HOME%\bin

Linux: "export PATH=$MAVEN_HOME/bin:$PATH"

and it's really not a good idea to actually use any of the maven software directories as a current (execution) directory. If you have the proper execution path setup, you can (and should) execute Maven while in the project's root directory.


Customer surveys are for companies who didn't pay proper attention to begin with.
Mehdi Ben Larbi
Ranch Hand

Joined: Aug 17, 2010
Posts: 70
Thanks,it's working now i had a bad version.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to Get Maven Installed
 
Similar Threads
Strange CLASSPATH Problem...
Maven doesn't take localRepository setting
Installing Java / Eclipse / Tomcat / Maven on Ubuntu 9.10
Error in Java Home in Ubuntu
Editing the bashrc file