我正在使用带有gradle的javadoc doclet,所以我需要使用package tools.jar,它位于jdk的lib文件夹中(在我的例子中为1.6.0_26).
重点是gradle没有自动获取它,所以我将该工具包添加到我的libs文件夹,然后将其添加到dependencies.gradle.
现在我想直接从我的JDK home转到我的dependencies.gradle.有没有办法做到这一点?我在我的dependencies.gradle中尝试了下一个:
compile files("${System.properties['java.home']}/lib/tools.jar")
Run Code Online (Sandbox Code Playgroud)
但它在编译时没有找到它.
今天我已将 MacBook 升级到 macOS Big Sur 版本 11.0.1。现在,当我尝试为 Android 构建项目时出现了一个问题。
Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.
Run Code Online (Sandbox Code Playgroud) 执行时出现此错误
react-native run-android
Run Code Online (Sandbox Code Playgroud)
我尝试将 tools.jar 文件复制到 JRE 安装位置,重新安装 JDK 和 JRE,检查路径的环境变量。没有任何效果。
它返回以下异常
info Starting JS server...
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
> Task :app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that C:\Program Files (x86)\Java\jre1.8.0_211 contains a valid JDK installation …Run Code Online (Sandbox Code Playgroud)