Nitrof
Nitrof

Reputation: 151

can't bluid cordova app: java Requirements check failed for JDK

I trid to build an app with cordova ionic 3, but I got the error :Requirements check failed for JDK 1.8.2. But I have version 9 install... here info:

ANDROID_HOME=C:\android
JAVA_HOME=C:\Program Files\Java\jdk-9.0.4\bin
Error: Requirements check failed for JDK 1.8 or greater

C:\...>ionic info

cli packages: (C:\...\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 6.3.0 windows 5.0.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.0.1
Node              : v9.0.0
npm               : 5.6.0
OS                : Windows 10

Environment Variables:

ANDROID_HOME : C:\android

Misc:

backend : pro

Upvotes: 1

Views: 5622

Answers (3)

Adolfo Cárdenas
Adolfo Cárdenas

Reputation: 17

put the other versions of JDK in a other folder and:

sudo -s

apt-get install gradle

ionic 2 - Error Could not find an installed version of Gradle either in Android Studio

Upvotes: 0

Newtorn Moses
Newtorn Moses

Reputation: 531

unstall any java sdk you have Install JDK 1.8 follow this link
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and then look for Java SE Development Kit 8u172 and accept aggreement then download it. and then change your enviroment variable to match the java sdk location e.g JAVA_HOME C:\Program Files\Java\jdk1.8.0_172

Upvotes: 2

Nitrof
Nitrof

Reputation: 151

For me, the solution was install 1.8 then not naming environment path "...\Java\jdk1.8.0_161\bin" but "...\Java\jdk1.8.0_161"

Upvotes: 0

Related Questions