0
votes

I am about to deploy library to JCenter.
but getting this error while running

gradlew install


Error:

  • What went wrong: Execution failed for task ':lib-my-lib:compileReleaseJavaWithJavac'. Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_45 contains a valid JDK installation.

Android studio is working fine with other projects but particularly this case it fails.

I tried all solutions available.
any help appreciated.

1

1 Answers

1
votes

I think You have installed jre instead of Oracle JDK you can download JDK from the link below and after downloading install it in your system and everything will be fine

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html