title: How to set JAVA_HOME environment variable on Mac OS X 10.9?
body: <p>I just purchased a brand new MacBook Pro. </p>
  
  <p>This is my first MAC ever and I'm still trying to get the hang of navigating my way around. </p>
  
  <p>Anyway, I'm also new to Java and I've been practicing on my Windows PC before it permanently died. </p>
  
  <p>Now that I'm on this MAC, I installed my JDK and now I need to set the <code>JAVA_HOME</code> environment variable. </p>
  
  <p>I have no idea what to do.</p>
  
  <p>I tried following some of these guides and didn't get very far.</p>
  
  <ol>
  <li><p><b><a href="http://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/" rel="noreferrer">Mkyong.com : How to set JAVA_HOME variable in Mac OSX</a></b></p></li>
  <li><p><b><a href="http://www.youtube.com/watch?v=aCEPrODy68o" rel="noreferrer">YouTube : How to set environment variables on mac, linux, solaris, rhel</a></b></p></li>
  <li><p><b><a href="http://youtube.com/watch?v=-cASjkF94dc" rel="noreferrer">YouTube : How to Set Environment Variables in Mac</a></b></p></li>
  </ol>
  
  <p>I was able to locate the terminal and I think I created some multiple files. I'm getting messages like this:</p>
  
  <hr>
  
  <blockquote>
    <p>(1) Another program may be editing the same file.
        If this is the case, be careful not to end up with two
        different instances of the same file when making changes.
        Quit, or continue with caution.</p>
  </blockquote>
  
  <hr>
  
  <blockquote>
    <p>(2) An edit session for this file crashed.
        If this is the case, use ":recover" or "vim -r /Users/Erwin/.bash_profile"
        to recover the changes (see ":help recovery").
        If you did this already, delete the swap file "/Users/Erwin/.bash_profile.sw p"
        to avoid this message.</p>
  </blockquote>
  
  <p>Can somebody tell how to set Java in Mac OSX environment step by step?</p>