Error: Requirements check failed for JDK 1.8 or greater

You also need to add your sdk “bin” folder to “PATH” environment variable. Example:

1 Like

i have also the same problem on my windows 10.
when i run java -version i got this

java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

and this is the path of my JAVA_HOME variable:

C:\Program Files\Java\jdk-9

i don(t understand
need help please

i’ve fixed it. the jdjk version on my windows was 9.0.0
i’ve uninstalled that version and installed the 1.8 version.
And it worked. :grinning:
Hope it would help someone:

1 Like

hi davidy,
How can we get jdk 1.8?

I’m on JDK 9. still getting this error. suggestions?

JDK 1.8 is nothing but JDK 8.
Find it here http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

I had same problem with JDK 9. Uninsatlled it and then installed JDK 8. Updated Environment variables.

1 Like

How I did it was like this:

  1. Apparently I had installed a few versions of JDK on my windows system so I have uninstalled all of them.

  2. Went here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and downloaded: Java SE Development Kit 8u151 and installed it

  3. Hit ‘cordova build android’ in my app folder (previously deleted my old platforms/android folder)

Well that was a sucky experience…
I took all of your advice and no luck (unless I missed one, sorry).
All of your points are valid, but there is one final requirement - currently:
Cordova doesn’t work with JDK 9 - yet! I thought getting the latest JDK was sensible, but no. Although, I expect later versions of Cordova to fix this.
After uninstalling and popping JDK 8 on + doing all the Path and JAVA_HOME stuff, it works!
This link helped me:

Hi,
Is there any information on when cordova will support JDK 9 ?

Also in https://ionicframework.com/docs/v1/guide/installation.html
Please dont tell windows users:

Java JDK

Install the most recent Java JDK (NOT just the JRE).

That will create some more useless searching :smiley:

Thanks

Feel free to create and submit a PR: https://github.com/ionic-team/ionic-site/blob/master/content/docs/v1/guide/installation.md

No, you would have to create an issue at issues.cordova.io for that.

1 Like

The PR is done.
I’ll let Cordova alone right now I bet they’re already working on that :wink:
Thanks

They are not if there is no issue for it requesting support. And even if, that information would be interesting to have and published here. (Maybe cordova-android 7.0.0 which was released a few days ago already did something about that? No idea.)

Hey,

Seems like they are not planning on fixing it right now :
https://issues.apache.org/jira/browse/CB-13524
https://issues.apache.org/jira/browse/CB-13606
https://issues.apache.org/jira/browse/CB-11343

Last one is the ref I think.

I’ll start watching that one.

worked for me, seems like cordova doesnt like jdk 9 just yet.

but i didnt uninstall jdk 9, just installed 8 and changed env variables to point to 8 and it worked.

Thanks

I’m experimentig the same problem here on my Mac.

cordova run android
ANDROID_HOME=/Users/jack/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home
Error: Requirements check failed for JDK 1.8 or greater

[ERROR] An error occurred while running cordova run android (exit code 1).

Solved by installing JAVA8 keeping my JAVA9, following this

Check PATH for user variables AND system variables is set to the correct jdk path location because I had initially only set the user variable PATH field which is why the build kept failing with the jdk 1.8 error

I fixed this issue by reset the JAVA Environment.

	$ sudo update-alternatives --config java

choose the number for /usr/lib/jvm/java-1.8.0-openjdk-amd64.

Press enter to keep the current choice[*], or type selection number:

To choose a default javac compiler, run the following command.

	$ sudo update-alternatives --config javac

If you prefer to use a gui instead of the command line, you can execute galternatives instead and define the default versions of software with the following dialog.

	$ sudo galternatives

IF you have installed java 9 above try to use java 8 for now by unistalling java jdk 9

ANDROID_HOME=C:\Users\Pavilion\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk-10.0.1
(node:21288) UnhandledPromiseRejectionWarning: CordovaError: Requirements check failed for JDK 1.8 or greater

i get this error , and i try to do what you have said but i still can’t fie the problem because i can’t uninstall the previous JDK 10.0 !!

I got solution by just install jdk using commands

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Thanks

Anes