0

I am receiving the error below upon executing cd andorid ./gradle assemble. It seems my project is missing a path to JDK how can I add/correct this?

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
Matt Laszcz
  • 373
  • 3
  • 20
  • Does this answer your question? [Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0\_151 contains a valid JDK installation](https://stackoverflow.com/questions/47291056/could-not-find-tools-jar-please-check-that-c-program-files-java-jre1-8-0-151-c) – Hakan Dilek Jul 04 '21 at 13:32
  • yes somewhat..im trying to have my JAVA_HOME path match the path of the installation of JAVA on my Mac and I am just not sure how to accomplish this – Matt Laszcz Jul 04 '21 at 13:43
  • usually setting `JAVA_HOME=YOUR_JDK_PATH` and adding `$JAVA_HOME/bin` to your `PATH` variable helps. – Hakan Dilek Jul 04 '21 at 14:12
  • yes! how can I find my JDK path and add $JAVA_HOME/bin to my path variable..I keep seeing these responses but I am not sure how to accomplish them is my issue. – Matt Laszcz Jul 04 '21 at 14:23

0 Answers0