Error: Requirements check failed for JDK 8 (‘1.8.*’)! Detected version: 12.0.1

I have faced this “Requirements check failed for JDK 8” error in Ionic Studio when I tried to run my newly created Ionic App in Android Device. The exact error was the following.

Requirements check failed for JDK 8 ('1.8.*')! Detected version: 12.0.1
Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.

Requirements check failed for JDK 8

Reason

This error happens because of the difference between the already installed version of JDK and what Cordova required to build the App. In my case the already installed JDK version is 12.0.1. and Cordova required JDK 8.

Solution

As it’s clear from the above reason, we need to install JDK 8 to run Ionic App successfully. We don’t need to uninstall the previously installed JDK version, we can keep both versions.

1. Download & Install JDK 8 from Oracle official Website.

2. Set JAVA_HOME environment variables to the JDK 8.

In Mac, run the following command to set environment variables.

touch ~/.bash_profile; open ~/.bash_profile

The above command will open your Text Editor with .bash_profile file. Add the following lines in this file. Don’t forget to change the paths according to your save locations of JDK 8 and Android SDK. In the following code, I’ve added the default paths.

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home
 export JAVA_HOME;
 ANDROID_HOME=/Users/YOUR_USERNAME/Library/Android/sdk
 export ANDROID_HOME;
 ANDROID_SDK_ROOT=/Users/YOUR_USERNAME/Library/Android/sdk
 export ANDROID_SDK_ROOT;

3. Save the .bash_profile file and Quit (Command + Q) in Text Editor.

4. Run command source ~/.bash_profile

Now close your terminal and rebuild the project. And the “Requirements check failed for JDK 8” error should be fixed. If you still face any problem, feel free to ask in the comments section. 🙂

You can also find other useful helping articles, code snippets and tutorials in our Coding Articles & Tutorials Knowledge Base.

Native Mobile Application Developer (Android + IOS) having experience in Java, Swift, Kotlin, Objective C, Unity, C#, C/C++, NODE JS & PHP.

One thought on “Error: Requirements check failed for JDK 8 (‘1.8.*’)! Detected version: 12.0.1

  1. Do you have a spam issue on this site; I also am a blogger, and I was wanting to know your situation; we have developed some nice procedures and we are looking to exchange techniques with others, please shoot me an email if interested.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.