Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
386 views
in Technique[技术] by (71.8m points)

android - Could not find tools.jar. Please check that C:Program FilesJavajre1.8.0_151 contains a valid JDK installation

Even though I manually configured JDK project structure file/Project structure it still shows this error FAILURE: Build failed with an exception.

`What went wrong: Execution failed for task ':sample:compileReleaseJavaWithJavac'.

Could not find tools.jar. Please check that C:Program FilesJavajre1.8.0_151 contains a valid JDK installation.`

I'm confused why it is still looking for C:Program FilesJavajre1.8.0_151 instead of JDK

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...