Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_221 contains a valid JDK installation.
See original GitHub issueWhen 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:
- Created 4 years ago
- Comments:8 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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
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