0

I'd like to set Maven home properly, because it has caused me soo much problems before. Can somebody help me do it properly?

So I was greeted with this when I first tried to run my test program:

enter image description here

Then when I click preferences:

enter image description here

This is what terminal tells me my maven home:

enter image description here

So can somebody guide me? Any help would be much appreciated, thanks in advance!

mosawi
  • 1,283
  • 5
  • 25
  • 48

3 Answers3

0

Really alls you need to do is set:

MVN_HOME = <DIR TO MAVEN>

in your .bash_profile in your home directory. Here's a good SO to help you if you want to read it: Maven Install on Mac OS X

Community
  • 1
  • 1
mattklamp
  • 293
  • 4
  • 13
0
  1. Try to echo your MAVEN_HOME environment variable, check if it matches the path printed by running "mvn -version". If not, set MAVEN_HOME to this path.
  2. Then restart your eclipse to see if eclipse can recognize it.
D_S_toowhite
  • 643
  • 5
  • 17
0

download maven zip file from http://maven.apache.org/download.cgi
extract zip file
click on Remote disk---> Show Enclosing Folders ---> Macointosh HD ---> Users
you'll see a folder whose icon looks like Home
this is your root folder or home folder
move your maven folder inside your home directory

now setting the env variable

open terminal

vi .bash_profile

i- for insert mode

export M2_HOME=/Users/kesharwanivikas/apache-maven-3.6.2 
export PATH=$PATH:$M2_HOME/bin 

Esc and ':wq'

close terminal and open a new one

type

mvn -version

you'll see that your maven is all set and ready !! Happy coding ✌

taras
  • 6,566
  • 10
  • 39
  • 50