question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_221 contains a valid JDK installation.

See original GitHub issue

When running the following command:

gradlew build check test

I get this error:

`:versionTxt :compileJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:compileJava’.

Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_221 contains a valid JDK installation.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --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 13s 2 actionable tasks: 2 executed`

Here is the gradle scan: https://scans.gradle.com/s/odv6gd45tem3u/

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

26reactions
chrisstencommented, Sep 16, 2019

@dikokob, I had the same problem. I just had to modify my JAVA_HOME to point to the jdk instead of the jre: SET JAVA_HOME=C:\Program Files\Java\jdk-12.0.2

6reactions
jawalonoskicommented, Sep 16, 2019

JRE is the Java Runtime Environment, it does not include a compiler.

You need the JDK: Java Development Kit.

You can install a JDK from a lot of sources. Here is one: https://adoptopenjdk.net

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find tools.jar. Please check that C:\Program Files ...
Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation.` I'm confused why it is still looking for C:\Program ...
Read more >
Could not find tools.jar. Please check that C:\Program Files ...
1. Please make sure both JDK and jre are on same versionError: Could not find tools. jar. Please check that C:\Program Files\Java\jre1.8.0_151 ...
Read more >
Gradle doesn't run because it can't find tools.jar in JRE
Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_121 contains a valid JDK installation.
Read more >
Java – Could not find tools.jar. Please check that C:\Program ...
Java – Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation. androidgradlejava.
Read more >
How to solve Flutter could not find tools.jar? fluttercorner.com
jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found