title: Invalid JAVA_HOME when build with cordova
body: <p>I am trying to emulate an app on my device with cordova in OpenSuse Leap 42.1.<br>
  But when I tried to emulate the app with the <code>cordova run</code> I get the error below:   </p>
  
  <pre><code>cordova run
  Running command: /home/soufraz/Projects/apps/myproject/platforms/android/cordova/run 
  ERROR: Error: Failed to run "java -version", make sure that you have a JDK installed.
  You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.
  Your JAVA_HOME is invalid: /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0
  
  ERROR running one or more of the platforms: Error: /home/soufraz/Projects/apps/myproject/platforms/android/cordova/run: Command failed with exit code 2
  You may not have the required environment or OS to run this project
  </code></pre>
  
  <p>I have the java installed and the paths set in <code>~/.profile</code>.<br>
  Which is the configuration error in my environment?</p>
  
  <p>Below my <code>.profile</code>:   </p>
  
  <pre><code>JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0
  export JAVA_HOME
  
  ANDROID_HOME=/home/soufraz/Install/android-sdk-linux
  export ANDROID_HOME
  
  PATH=$PATH:$ANDROID_HOME:$JAVA_HOME
  </code></pre>
  
  <p>Info about java version:    </p>
  
  <pre><code>java -version
  openjdk version "1.8.0_60"
  OpenJDK Runtime Environment (build 1.8.0_60-b27)
  OpenJDK 64-Bit Server VM (build 25.60-b23, mixed mode)
  </code></pre>
  
  <p>And here the list of jvm folder:</p>
  
  <pre><code>ls -l
  total 28
  lrwxrwxrwx 1 root root 24 Nov 12 11:28 java-1.7.0-openjdk -&gt; java-1.7.0-openjdk-1.7.0
  drwxr-xr-x 1 root root  6 Nov 12 11:28 java-1.7.0-openjdk-1.7.0
  drwxr-xr-x 1 root root  6 Nov 11 17:26 java-1.8.0-openjdk-1.8.0
  lrwxrwxrwx 1 root root 21 Nov 11 17:26 jre -&gt; /etc/alternatives/jre
  lrwxrwxrwx 1 root root 27 Nov 12 11:28 jre-1.7.0 -&gt; /etc/alternatives/jre_1.7.0
  lrwxrwxrwx 1 root root 28 Nov 12 11:28 jre-1.7.0-openjdk -&gt; java-1.7.0-openjdk-1.7.0/jre
  lrwxrwxrwx 1 root root 27 Nov 11 17:26 jre-1.8.0 -&gt; /etc/alternatives/jre_1.8.0
  lrwxrwxrwx 1 root root 28 Nov 11 17:26 jre-1.8.0-openjdk -&gt; java-1.8.0-openjdk-1.8.0/jre
  lrwxrwxrwx 1 root root 29 Nov 11 17:26 jre-openjdk -&gt; /etc/alternatives/jre_openjdk
  </code></pre>
  
  <p><strong>[edit]</strong> View tree with three levels:</p>
  
  <pre><code>tree -L 3
  .
  ├── java-1.7.0-openjdk -&gt; java-1.7.0-openjdk-1.7.0
  ├── java-1.7.0-openjdk-1.7.0
  │   └── jre
  │       ├── bin
  │       └── lib
  ├── java-1.8.0-openjdk-1.8.0
  │   └── jre
  │       ├── bin
  │       └── lib
  ├── jre -&gt; /etc/alternatives/jre
  ├── jre-1.7.0 -&gt; /etc/alternatives/jre_1.7.0
  ├── jre-1.7.0-openjdk -&gt; java-1.7.0-openjdk-1.7.0/jre
  ├── jre-1.8.0 -&gt; /etc/alternatives/jre_1.8.0
  ├── jre-1.8.0-openjdk -&gt; java-1.8.0-openjdk-1.8.0/jre
  └── jre-openjdk -&gt; /etc/alternatives/jre_openjdk
  </code></pre>