title: Gradle does not recognize the JAVA_HOME I have set
body: <p>I have set my <code>JAVA_HOME</code> to <code>/usr/lib/jvm/java-7-oracle</code>, which contains a valid JVM, but gradle insists on using <code>/usr/lib/jvm/default-java</code> and complains about <code>JAVA_HOME</code>:</p>
  
  <pre><code>$ echo $JAVA_HOME 
  /usr/lib/jvm/java-7-oracle
  $ ls $JAVA_HOME
  bin  COPYRIGHT  db  include  jre  lib  LICENSE  man  README.html  release  src.zip  THIRDPARTYLICENSEREADME-JAVAFX.txt  THIRDPARTYLICENSEREADME.txt
  $ gradle assemble
  
  ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/default-java
  
  Please set the JAVA_HOME variable in your environment to match the
  location of your Java installation.
  </code></pre>
  
  <p>How can I fix this and have gradle use my valid <code>JAVA_HOME</code>?</p>
  
  <p><em>Note: My <code>JAVA_HOME</code> is set by <code>~/.bashrc</code> using <code>export JAVA_HOME="/usr/lib/jvm/java-7-oracle"</code></em></p>