How To Fix “ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation”?
Are you having problems with the issue “ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation“? How to fix it? In today’s article, I will provide solutions for you to solve the issues. Please follow the below steps to get the problem resolved now
How did “ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation” occur?
ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation
When you work with JAVA, you may get the issue ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation. Don’t worry, we are here to provide you solutions in order to resolve your problem.
How to fix “ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation”?
To Solve ERROR: Couldn’t find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a vapd JDK installation Error You Just need to add java home JDK path in gradle.properties Just pke this: org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_144 Then try to rebuild project. Your error must now be fixed. The second solution is to simply add tools.jar to this Path. First, copy tools.jar file to C:\Program Files\Java\jdk1.8.0_121\pb. Next, paste C:\Program Files\Java\jre1.8\pb here. Your error must now be fixed.
Solution 1: Add Java Home in Gradle.properties
Simply add Java Home JDK Path to Gradle.properties.
org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_144
Next, rebuild the project. Your error must now be fixed.
Solution 2: Copy tools.jar
Simply add tools.jar to C:\Program Files\Java\jre1.8\lib to create this Path.
- Copy tools.jar file starting at C:\Program Files\Java\jdk1.8.0_121\lib
- Copy and Paste the C:\Program Files\Java\jre1.8\lib code here.
- Your error must now be fixed
Solution 3: Add JAVA_HOME environment variables
Make sure that you have added JAVA_HOME environment variables. Follow this procedure if you have not.
- First, download and install the JDK from Oracle. It should have the same version number than the JRE.
- Add JAVA_HOME in the Windows environment variables.
- It should look like this. C:\Program Files\Java\jdk1.8.0_121
- To load the new JAVA_HOME value, restart your terminal or development environment.
- Now, your error must be fixed.
Final words
The above are useful solutions that can help you fix “ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation” problem, if you can’t solve it well. Please leave a message.