Compiling Java projects with Gradle error: Could not find Tools.jar

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.