首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由于JDK-9的原因,无法使用离子型构建android。

由于JDK-9的原因,无法使用离子型构建android。
EN

Stack Overflow用户
提问于 2016-09-29 02:39:07
回答 2查看 2.1K关注 0票数 0

我有一个ionic 2.0.0-rc0应用程序,我想构建一个安卓平台。当我运行ionic run android时,它会在中间失败。斯塔克跟踪-

代码语言:javascript
复制
   > ionic-hello-world@ build /home/raj/ionic/github
    > ionic-app-scripts build
    [07:46:11]  ionic-app-scripts 0.0.23
    [07:46:11]  build prod started ...
    [07:46:11]  clean started ...
    [07:46:11]  clean finished in 9 ms
    [07:46:11]  copy started ...
    [07:46:11]  ngc started ...
    [07:46:11]  lint started ...
    [07:46:11]  copy finished in 171 ms
    [07:46:12]  lint finished in 960 ms
    [07:46:26]  ngc finished in 15.36 s
    [07:46:26]  bundle prod started ...
    [07:46:34]  bundle prod finished in 8.27 s
    [07:46:34]  sass started ...
    [07:46:36]  sass finished in 1.67 s
    [07:46:36]  minify started ...
    [07:46:36]  cleancss started ...
    [07:46:36]  uglifyjs started ...
    [07:46:47]  uglifyjs finished in 10.80 s
    [07:46:47]  cleancss finished in 10.80 s
    [07:46:47]  minify finished in 10.80 s
    [07:46:47]  build prod finished in 36.12 s
    Running command: /home/raj/ionic/github/hooks/after_prepare/010_add_platform_class.js /home/raj/ionic/github

    :CordovaLib:compileDebugJavaWithJavac FAILED


    FAILURE: Build failed with an exception.
    Error: /home/raj/ionic/github/platforms/android/gradlew: Command      failed with exit code 1 Error output:
    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.
    > Could not create an instance of type com.sun.tools.javac.api.JavacTool.

我使用genymotion作为仿真器,尽管我认为这在这个问题上并不重要。解决此问题的许多方法是设置JAVA_HOME路径。但我已经设置好了,echo $JAVA_HOME > /usr/lib/jvm/java-9-openjdk-amd64。我怀疑这是gradle 2.1java-9的一个问题。我在这个问题上已经坚持了一段时间了,任何帮助都将不胜感激。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-09-29 06:10:04

愚蠢的我认为,当伟大的JDK-9甲骨文警告我不要尝试它的时候,尝试它是一个好主意。删除并安装JDK-8,解决问题。甲骨文确实看到了我的未来。

票数 3
EN

Stack Overflow用户

发布于 2016-09-29 05:32:48

代码语言:javascript
复制
 cordova platform update android
 ionic build android
 ionic run android

试着运行这些命令。希望这能帮到你:)

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39760515

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档