0

When I run the following command:

ionic cordova build android --prod --release

I get an error:

ANDROID_HOME=C:\Users\myuser\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk-9.0.1
Error: Requirements check failed for JDK 1.8 or greater

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

Why does it fail? My jdk version is 9.0.1, which is definitely greater than 1.8.

I saw the following suggestions on the Internet: 1) Uninstall older JDK versions - but I don't have an older version 2) Update some environment variables - didn't help either

I'm running Windows 10 (64-bit).

Ideas?

Slavik N
  • 4,705
  • 17
  • 23

2 Answers2

0

Someone posted an answer here, I tested it, and it worked. When I returned in order to accept it, the answer turned out to be deleted for some reason.

Anyway, the answer is:

1) Configure the ANDROID_HOME environment variable based on the location of the Android SDK.
2) Add ANDROID_HOME/tools, and ANDROID_HOME/platform-tools to your PATH.

Slavik N
  • 4,705
  • 17
  • 23
0

Configuring ANDROID_HOME haven't worked for me.

The solution for my problem was given by Bilash in this link:
Uninstall JDK 9 and install JDK 8.

Pang
  • 9,564
  • 146
  • 81
  • 122
LucasR
  • 11
  • 1