title: Maven, JAVA_HOME w/ OS X
body: <p>Trying to get Maven, Java, and OS X to play nice together - something I've done multiple times without issue on Linux and Windows machines. I assumed all I needed to do was download Maven, setup my environment variables and I'd be good. So here's a snippet from my .bash_profile...</p>
  
  <pre><code>export JAVA_HOME=/Library/Java/Home/  
  export M2_HOME=/usr/local/apache-maven/apache-maven-2.2.1  
  export PATH=$PATH:$M2_HOME/bin
  </code></pre>
  
  <p>The <code>JAVA_HOME</code> setting is what Apple recommends be used on <a href="http://developer.apple.com/mac/library/qa/qa2001/qa1170.html" rel="noreferrer">this Q&amp;A page</a>. Yet after launching a terminal and running <code>mvn --version</code>, here's the output...</p>
  
  <pre><code>Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)  
  Java version: 1.6.0_17  
  Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home  
  Default locale: en_US, platform encoding: MacRoman  
  OS name: "mac os x" version: "10.6.2" arch: "x86_64" Family: "mac"
  </code></pre>
  
  <p>Any idea why the <code>JAVA_HOME</code> I'm setting in my .bash_profile is being ignored by Maven? It's causing problems because things like <code>rt.jar</code> aren't found in the <code>JAVA_HOME</code> Maven is using. I can work around this by creating symbolic links and other hackery in the home Maven is using, but I'd rather have it work correctly since this will just blow up on me the next time Apple pushes a Java update. Thanks for any help...</p>