2017-02-01 56 views
0
cordova platform add android 

Subproject Path: CordovaLib 
Android project created with [email protected] 
Installing "cordova-plugin-whitelist" for android 
ANDROID_HOME=C:\Users\Proxymis\AppData\Local\Android\sdk1 
JAVA_HOME=C:\Program Files\Java\jre1.8.0_121 
Failed to install 'cordova-plugin-whitelist':CordovaError: Requirements check failed for JDK 1.8 or greater 
    at C:\Users\Proxymis\Desktop\sendSMS\platforms\android\cordova\lib\check_reqs.js:278:19 
    at _fulfilled (C:\Users\Proxymis\Desktop\sendSMS\platforms\android\cordova\node_modules\q\q.js:834:54) 
    at self.promiseDispatch.done (C:\Users\Proxymis\Desktop\sendSMS\platforms\android\cordova\node_modules\q\q.js:863:30) 
    at Promise.promise.promiseDispatch (C:\Users\Proxymis\Desktop\sendSMS\platforms\android\cordova\node_modules\q\q.js:796:13) 
    at C:\Users\Proxymis\Desktop\sendSMS\platforms\android\cordova\node_modules\q\q.js:604:44 
    at runSingle (C:\Users\Proxymis\Desktop\sendSMS\platforms\android\cordova\node_modules\q\q.js:137:13) 
    at flush (C:\Users\Proxymis\Desktop\sendSMS\platforms\android\cordova\node_modules\q\q.js:125:13) 
    at _combinedTickCallback (node.js:370:9) 
    at process._tickCallback (node.js:401:11) 
Error: Requirements check failed for JDK 1.8 or greater 

我覺得我的環境在正常:科爾多瓦加入平臺:無法安裝「科爾多瓦 - 插件白名單」 CordovaError:要求檢查失敗JDK 1.8或更高

JAVA_HOME 
C:\Program Files\Java\jdk1.8.0_121 

java -version 
java version "1.8.0_121" 
Java(TM) SE Runtime Environment (build 1.8.0_121-b13) 
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) 
+1

'JAVA_HOME = C:\ Program Files文件\的Java \ jre1.8.0_121'它是撿了JRE不jdk..what不'回聲%JAVA_HOME%'說什麼? –

+0

我的答案能解決你的問題嗎? – juvchan

回答

2

你應該設置你的JAVA_HOME環境變量到JDK根文件夾而不是JRE文件夾,如下所示。

糾正你的JAVA_HOME後,做一個

cordova requirements android 

,以驗證在見面科爾多瓦android平臺環境的要求。

enter image description here