• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to Get Maven Installed

 
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you get when you type --> echo %M2_HOME% in command prompt?
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


That seems to come out fine.
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Vijitha and Srikanth. That solved the problem!!
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Mehdi Ben Larbi
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,it's working now i had a bad version.
 
Your buns are mine! But you can have this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic