ive tried :
echo $M2_HOME
/usr/local/apache-maven-3.2.3
seemd like M2_HOME is set
and the file /etc/launchd.conf looks like this:
setenv $M2_HOME /usr/local/apache-maven-3.2.3
ive restarted the mac and still nothing works ...
any idea ?
checkout :
"and the file /etc/launchd.conf looks like this:"
change :
setenv $M2_HOME /usr/local/apache-maven-3.2.3
to
setenv M2_HOME /usr/local/apache-maven-3.2.3
Create new file /Library/LaunchDaemons/setenv.M2_HOME.plist:
<?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>Label</key>
<string>setenv.BAR</string>
<key>ProgramArguments</key>
<array>
<string>/bin/launchctl</string>
<string>setenv</string>
<string>M2_HOME</string>
<string>/opt/local/share/java/apache-maven-3.1.1</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>
Then restart the computer, or execute
launchctl load -w /Library/LaunchDaemons/setenv.M2_HOME.plist
Relaunch IDEA, and it picks up MAVEN_HOME. Tested on Yosemite 10.10.3.
Source: http://lajosd.blogspot.be/2015/06/place-following-content-enhance-it-to.html
来源:https://stackoverflow.com/questions/27529332/m2-home-not-working-in-intellij-on-osx-10-10-1-yosemite