When using Android studio to compile into a jar, encountered gradle compilation errors, listen to the predecessors said that the JDK version is incorrect, and then updated the JDK, but maybe I reinstalled the JDK when the installation path changed
Configure the path in project structure, but still error: Gradle compile Java project times wrong: Could not find Tools.jar
This is because Gradle cannot find the JDK directory and can be resolved by setting the Gradle Global Properties Java.home.
Locate the. Gradle directory under the current user directory, locate the Gradle.properties file, and then enter the following in the file:
Org.gradle.java.home=D:\androidstudio\myjdk \ \ JDk
Please replace the green text with the actual installation location of the local JDK.
and then recompile.
Compiling Java projects with Gradle error: Could not find Tools.jar