Error: Requirements check failed for JDK 1.8 or greater on Ionic

I have an Ionic app which started to fail when I run:

ionic cordova run android --consolelogs --device --livereload

I get this error:

ANDROID_HOME=/home/ivan/Android
JAVA_HOME=/usr/lib/jvm/java-10-oracle/
Error: Requirements check failed for JDK 1.8 or greater

My environment variables are:

echo $JAVA_HOME
/usr/lib/jvm/java-10-oracle/

echo $ANDROID_HOME
/home/ivan/Android

My current versions:

java -version
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

javac -version
javac 10.0.2

Ionic info:

cli packages: (/usr/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 3.1.10
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.0.2
    Node              : v6.14.3
    npm               : 4.6.1 
    OS                : Linux 4.4

Environment Variables:

    ANDROID_HOME : /home/ivan/Android

Misc:

    backend : legacy

I don’t know what’s happening here. Any ideas?

Thank’s in advance!

1 Like
  1. Downgrade Java to a version like 8

or

  1. Update your cordova-android version to the last one, respectively 7.1.1 (Cordova Android 7.1.1 Released! - Apache Cordova / CB-14101 Fix Java version check for Java >= 9 (GH-446))
1 Like

Hello! Thank you for your help!

I’m trying to do the steps mentioned in the link but when I try to add the android platform, it fails because cordova is not creating an AndroidManifest.xml file.

This is an example error (it happens with all the plugins):

Failed to install 'cordova-plugin-device': Error: ENOENT: no such file or directory, open '/media/ivan/SharedPartition/Trabajo/AnimaEdu/animaedu-mobile/platforms/android/AndroidManifest.xml'

Just to mention it: This problem happened to me having version 8 of the sdk installed. That’s why I updated it at 10 to check if it was corrected but unfortunately it was not corrected.

It isn’t the same issue anymore then, you should open a new one and document how you solved your original issue

About your problem itself, maybe remove and add the platform again?

Can’t tell more than this without more info, when you open your new issue, plz document it a bit more that may help