关于离子cordova运行android的JDK错误 [英] JDK Error on ionic cordova run android
问题描述
ANDROID_HOME = C:\Users\tgiak\AppData\Local\Android\sdk
JAVA_HOME = C:\Program Files\Java\jdk -9.0.4
(节点:11252)UnhandledPromiseRejectionWarning:未处理的承诺拒绝(拒绝ID:1):CordovaError:要求检查失败JDK 1.8或更大
(节点:11252)[DEP0018] DeprecationWarning:未处理承诺拒绝被弃用。将来,未处理的承诺拒绝将使用非零退出代码终止Node.js进程。
ANDROID_HOME=C:\Users\tgiak\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files\Java\jdk-9.0.4 (node:11252) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Requirements check failed for JDK 1.8 or greater (node:11252) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
仍然可以获得此错误,在升级Java后重新安装了所有npm模块。我无能为力。
Still get this error, re-installed all the npm modules after upgrading Java. I can do nothing more.
推荐答案
Android SDK 不支持JDK 9.它支持一些 JDK 8 功能,因此可以使用。
Android SDK does not support JDK 9. It has support for some of JDK 8 features and hence can be used.
因此,Ionic和Cordova应用程序无法在Android平台上使用JDK 9。您需要安装JDK 8并将JAVA_HOME重置为JDK 8并尝试。
为了验证您的设置是否有效,请使用以下命令:
Consequentially, Ionic and Cordova apps cannot use JDK 9 for Android platform. You will need to install JDK 8 and reset JAVA_HOME to JDK 8 and try. In order to verify if your setup works, use the command:
cordova requirements
。
这篇关于关于离子cordova运行android的JDK错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!