title: Cordova build android failing due to JAVA_HOME error
body: <p>I am on mac and trying to build my cordova project for Android. Whenever I run <code>cordova build android</code> I get following error:</p>
  
  <pre><code>$ cordova build android
  ANDROID_HOME=/Users/sharmanitin/Library/Android/sdk
  JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home
  Subproject Path: CordovaLib
  
  ERROR: JAVA_HOME is set to an invalid directory: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home
  
  Please set the JAVA_HOME variable in your environment to match the
  location of your Java installation.
  </code></pre>
  
  <p>Result for ECHO $JAVA_HOME:</p>
  
  <pre><code>$ echo $JAVA_HOME
  /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home
  </code></pre>
  
  <p>Both JAVA and JAVAC command work fine in my terminal. Also, not sure if it matters buy I am using <a href="https://github.com/robbyrussell/oh-my-zsh" rel="nofollow noreferrer">zsh</a> instead of bash on my mac.</p>