Error: Requirements check failed for JDK 1.8 or greater


I wanted to launch the commands:

ionic build android 


ionic run android --device

But he always throws me this eror:

Error: Requirements check failed for JDK 1.8 or greater

The version of java I have is 1.8.0_111, I have the environment variables defined, but I do not know why I get this error. I went back to disarming the jdk to see if that solved the error as I read it in other pages and I have the Android sdk so I have no idea why the error.

asked by Fabian 08.01.2017 в 06:36

2 answers


I assume you have the JDK 8 but that you have installed an additional JRE in another version. Consider that the JDK already includes a JRE.

Two possible solutions:

  • It is necessary to remove the folder android folder from the platform and execute execute ionic run android this will reinstall the platform automatically and build from scratch. I think the cache files are the problem ..
  • I downloaded Android Studio again. Try a simple application that executes a hello world in Java. Then install everything necessary for ionic and cordova. Run your code and see if it works for you.
  • Check out this link that can help you.

    answered by 08.01.2017 / 12:59

    I did the following, I executed:

    alternatives --config java

    I got two:

    jdk1.7.../java y jdk1.8.../java

    Version 1.8 was correctly selected

    Then I executed:

    alternatives --config javac

    javac , not java ! (The compiler)

    There was only the alternative jdk1.7 .... / javac .

    I looked for how to install a new alternative and it is done like this (the last parameter will surely be different in each case):

    alternatives --install /usr/bin/javac javac /opt/... jdk 1.8..../javac

    Then I executed:

    alternatives --config javac

    Then, I selected the newly installed alternative, and I was able to generate the APK !

    answered by 22.01.2017 в 04:32