title: Cordova is running the wrong Java version. How do I get Cordova to run a specific Java version?
body: <pre><code>[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
  </code></pre>
  
  <p>and</p>
  
  <pre><code>error: strings in switch are not supported in -source 1.5
      [javac]    switch (xmlData[i][1]) {
      [javac]           ^
      [javac]   (use -source 7 or higher to enable strings in switch)
  </code></pre>
  
  <p>I am getting warnings and errors that I am running Java 1.5 when compiling an APK with Cordova for Android. I can't use strings in switch statements. (the compilation process errors)</p>
  
  <p>My system is 64-bit Windows 7. My Cordova version is 3.5. I am using git-scm. (<a href="http://git-scm.com/" rel="nofollow">http://git-scm.com/</a>)</p>
  
  <ul>
  <li>I am running this command: <code>cordova run android --release</code>.</li>
  <li>My Java environment variable lists <code>C:\Program Files\Java\jdk1.8.0_20</code> as the Java directory.</li>
  <li>My path enviroment variable sets the Java path as the first item in the list.</li>
  <li>Every Java patch and version is uninstalled except what I just re-installed from Oracle's site.</li>
  <li>I restarted my computer.</li>
  <li><code>java -version</code> gives me <code>java version "1.8.0_20"</code>.</li>
  <li><code>javac -version</code> gives me <code>javac 1.8.0_20</code>.</li>
  <li>All my targets are <code>=android-19</code>, <code>=debug</code>, or <code>=release</code>.</li>
  <li><code>android:minSdkVersion</code> is always set to "14", everywhere.</li>
  <li><code>android:targetSdkVersion</code> is always set to "19", everywhere.</li>
  </ul>
  
  <p>How can I force Cordova to run Java 8?</p>