Skip to content
Advertisement

Java 11 requirements check failed for JDK 1.8 or greater with Cordova

When I run ““cordova run android“` in the path of my project I get

JavaScript

My version of Java

JavaScript

My version of javac

JavaScript

My version of Cordova

JavaScript

My version of Node

JavaScript

My version of Nodejs

JavaScript

My version of NPM

JavaScript

My version of Gradle

JavaScript

I found that android-studio --version didn’t do anything but silently wait, but when I open the program through the graphical user interface I see that the version is 3.6.1.

My version of androidsdk is Unknown… Not sure why.

JavaScript

My version of Ubuntu

JavaScript

My understanding is that Java 11 comes later than JDK 1.8, so why does the requirements check fail? And, how do I fix this requirements check failure?

Advertisement

Answer

Update:

Java 11 is supported for cordova 10+ which allows for the same minimum Android versions as cordova 9. This should now be the preferred solution.


Original answer (for reference):

You are correct that Java 11 is more recent than JDK 1.8 and that it should work in theory.

However, cordova explicitly requires JDK 1.8 still:

Android doesn’t use oracles java but their own implementation, which at the moment is like java 8. So this is an android limitation, not something cordova can fix.

(cf. also issue 510)

Their development guide explicitly mentions JDK 1.8 as well:

Java Development Kit (JDK)

Install Java Development Kit (JDK) 8.

So the fix for now would be installing JDK 1.8 (if you go for Oracle note their recently changed license terms). You may watch PR 928 that attempts to ease that restriction, though.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement