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

We Are Going To Discuss About Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation. So lets Start this Java Article.

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

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

    At last, here I found the solution.
    I added jdk path org.gradle.java.home=C\:\\Program Files\\Java\\jdk1.8.0_144 to gradle.properties file and did a rebuild. It works now.

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

    At last, here I found the solution.
    I added jdk path org.gradle.java.home=C\:\\Program Files\\Java\\jdk1.8.0_144 to gradle.properties file and did a rebuild. It works now.

Solution 1

Advertisements

At last, here I found the solution.

I added jdk path org.gradle.java.home=C\:\\Program Files\\Java\\jdk1.8.0_144 to gradle.properties file and did a rebuild. It works now.

Original Author Viswesvar Sekar Of This Content

Solution 2

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

Copy tools.jar from C:\Program Files\Java\jdk1.8.0_121\lib to C:\Program Files\Java\jre1.8\lib.

It’s resolved the problem now.

Original Author Anup Singh Of This Content

Solution 3

Advertisements

Just had this happen to me.

Apparently Java’s automatic updater installed and configured a new version of the JRE for me, while leaving the old JDK intact. So even though I did have a JDK, it didn’t match the currently “active” JRE, which was causing the error.

Download a matching version of the JDK to the JRE you currently have installed, (In OP’s case 151) That should do the trick.

Original Author Marco Aurélio Of This Content

Solution 4

Advertisements

I had the same problem and fixed it like this:

  1. Install the JDK from the Oracle website with the same version number
    as the JRE if you didn’t already.
  2. Furthermore add JAVA_HOME to the environment variables of Windows.
  3. Restart your terminal or development environment to load the new JAVA_HOME value.

JAVE_HOME in System Environment Variables

Original Author Ton Snoei Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment