title: Setting Java home enviroment variable in OSX Mavericks
body: <p>I am having issues with my Java path.</p>
  
  <p>I have installed the latest version of Java 1.7.0_51. When I open the Java control panel it tells me <strong>"Your system has the recommended version of Java."</strong></p>
  
  <p><img src="https://i.stack.imgur.com/5AYPr.jpg" alt="Java Control Panel"></p>
  
  <p>However when I go to terminal and type <code>java -version</code> I get </p>
  
  <pre><code>java version "1.6.0_32"
  </code></pre>
  
  <p>So after searching around I came across this <a href="https://stackoverflow.com/questions/6588390/where-is-java-home-on-osx-lion-10-7-mountain-lion-10-8-or-mavericks-10-9">SO Question</a> which tells me that my Java home environment variable needs to be set. </p>
  
  <p>I then opened the bash_profile file and added the below line to the top of the file, above my Python path info.</p>
  
  <pre><code>export JAVA_HOME=`/usr/libexec/java_home -v 1.7.0_51`
  
  
  # Setting PATH for Python 2.7
  # The orginal version is saved in .bash_profile.pysave
  PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
  export PATH
  </code></pre>
  
  <p><strong>NOTE:</strong> I have tried this with both <code>-v 1.7.0_51</code> and <code>-v 1.7</code> </p>
  
  <p>I save the file and recheck in terminal but it is still showing </p>
  
  <pre><code>java version "1.6.0_32" 
  </code></pre>
  
  <p>when I restart Terminal I do however see </p>
  
  <pre><code>Last login: Wed Feb 19 23:32:19 on ttys000
  Unable to find any JVMs matching version "1.7".
  localhost:/ user$
  </code></pre>
  
  <p>Note: <strong>Unable to find any JVMs matching version "1.7".</strong> </p>
  
  <p>So it is trying to look for my 1.7, but just not finding it.</p>
  
  <p>What am I doing wrong?</p>