Search code examples
javacordovaionic-frameworkphonegapandroid-build

Cordova android run/build Error - Requirements check failed for JDK 1.8


I have built my cordova app and getting "Requirements check failed for JDK 1.8" error message.

Uninstalling all java and installing jdk 1.8 not solved my problem.

D:\xampp\htdocs\aware>cordova run android Android Studio project detected ANDROID_HOME=C:\Users\Baha\AppData\Local\Android\Sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_221 Requirements check failed for JDK 1.8

ScreenShots: Error message when cordova runs/builds android

JAVA_HOME ENV.

JDK setup

jdk folder


Solution

  • You might have installed more than one Java (binaries) on your system. First of all, check this, by executing where java command in your cmd.exe (command line).

    1. Most likely, you will see more than one java.exe installed, and if so, this may be the reason, despite installing new Java, your system still provides one more other version of it;
    2. Even if you have set your %JAVA_HOME% environment variable accordingly, there might be another java.exe available in your environment, either because of having some other Java binaries' bin folder added in the System variables' (under Environment Variables) Path variable, or because of having it at some other place, which is also available through any other environment variable (for instance: System32 on Windows).

    Check where java and see your Path environment variable under the System Variables.