Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ can't find my M2_HOME, why is that? [duplicate]

When I create a new Maven project, I see an error message that says:

[FATAL_ERROR] Cannot start Maven: No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system.

In terminal (I'm on a Mac) if I do:

echo $M2

echo $M2_HOME

it displays the full path to my /apache-maven-3.0.3/bin and /apache-maven-3.0.3 folders.

Why would IntelliJ not be able to pick this up?

like image 745
Blankman Avatar asked Dec 04 '25 18:12

Blankman


1 Answers

Environment variables set in terminal are not always visible to GUI applications:

  • http://apple.stackexchange.com/q/51677
  • http://apple.stackexchange.com/q/57385/17551
  • http://stackoverflow.com/q/135688/104891
like image 154
CrazyCoder Avatar answered Dec 06 '25 08:12

CrazyCoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!