首页 > 解决方案 > 我的反应原生项目/应用程序中缺少 JDK。找不到 Tools.jar 或 JDK

问题描述

我在执行 cd andorid ./gradle assemble 时收到以下错误。看来我的项目缺少 JDK 的路径我该如何添加/更正这个?

Execution failed for task ':app:compileReleaseJavaWithJavac'.
> Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
17 actionable tasks: 2 executed, 15 up-to-date
mattlaszcz@Matts-MBP android % /usr/libexec/java_home -V | grep jdk
Matching Java Virtual Machines (1):
    1.8.291.10 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

标签: javareact-nativeandroid-studiogradle

解决方案


推荐阅读