2

I am trying to get IntelliJ to understand where the path variable M2_HOME is, obviously I am failing. I have added it in the .bashrc but after what I read from other posts this on sets the variable in the CLI. Where should I add it, and so it is set each time I login?

I have read the other StackOverflow posts about the topic but I don't understand where I should add it.

LuckyLuke
  • 47,771
  • 85
  • 270
  • 434

1 Answers1

7

To set it you can either edit your ~/.MacOSX/environment.plist to add your env variables (such as M2_HOME)

Here is mine :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>M2_HOME</key>
    <string>/usr/local/Cellar/maven/2.2.1/libexec</string>
</dict>
</plist>

Or you can set it manually in IntelliJ's configuration: IntelliJ configuration panel


Related issues:

Resources:

Community
  • 1
  • 1
Colin Hebert
  • 91,525
  • 15
  • 160
  • 151