不能bluid cordova应用程序:Java JDK的要求检查失败

时间:2018-02-09 18:33:14

标签: java android cordova ionic3

我试图用cordova ionic 3构建一个应用程序,但是我收到了错误:JDK 1.8.2的需求检查失败。但我有版本9安装...这里信息:

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

3 个答案:

答案 0 :(得分:1)

取消安装任何已安装JDK 1.8的java sdk。点击此链接
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html然后查找Java SE Development Kit 8u172并接受aggreement然后下载它。然后更改您的环境变量以匹配java sdk位置,例如JAVA_HOME C:\ Program Files \ Java \ jdk1.8.0_172

答案 1 :(得分:0)

对我来说,解决方案是安装1.8然后没有命名环境路径" ... \ Java \ jdk1.8.0_161 \ bin"但是" ... \ Java \ jdk1.8.0_161"

答案 2 :(得分:0)

将其他版本的JDK放在另一个文件夹中,然后:

sudo -s

apt-get install gradle

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