I recently upgraded to Yosemite and my maven stopped working. I figured that was because my environment variables were not set, so I followed this post and created an environment.plist file.
<?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>my.startup</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>
launchctl setenv M2_HOME /Applications/dev/apache-maven-2.2.1
launchctl setenv M2 /Applications/dev/apache-maven-2.2.1/bin
launchctl setenv JAVA_HOME $(/usr/libexec/java_home)
launchctl setenv PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:$(/usr/libexec/java_home):/Applications/dev/apache-maven-2.2.1/bin
</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
But I still get command not found in for Maven, and for some reason $PATH is not set, others are
MAC-R4498:~ r4498$ mvn --version
-bash: mvn: command not foundMAC-R4498:~ r4498$ echo $M2_HOME
/Applications/dev/apache-maven-2.2.1MAC-R4498:~ r4498$ echo $JAVA_HOME
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/HomeMAC-R4498:~ r4498$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
So I added $PATH to the ~/.bash_profile
export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:$(/usr/libexec/java_home):/Applications/dev/apache-maven-2.2.1/bin"
And mvn started working through the terminal
MAC-R4498:~ r4498$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home:/Applications/dev/apache-maven-2.2.1/binMAC-R4498:~ r4498$ mvn --version
Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500)
Java version: 1.6.0_65
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.10.3" arch: "x86_64" Family: "mac"
But when I run any maven command from eclipse, I get this
Does anyone know what I am missing?
which mvn
return? – nitind