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
399 views
in Technique[技术] by (71.8m points)

java - Android Studio - supplied javaHome is not a valid folder

I decided to update my JDK to Java 8, and installed to the default location of C:Program FilesJavajdk1.8.0 with a jre subdirectory.

I wasn't sure how Android Studio worked out the JDK location, so I decided to launch it and see. I got the following message:

Failed to complete Gradle execution.

Cause: Supplied javaHome is not a valid folder. You supplied: C:Program FilesJavajdk1.7.0_45

I updated my JAVA_HOME environment variable (both for system and user) to point to the new path, and tried adding it to my PATH variable as well, but every time I attempt to build in Android Studio I get the same message. The quoted path is nowhere to be found in my environment variables though, so where is it getting it from and how can I change it?

Thanks

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

The problem was my project's JDK location. From the Android Studio Project tool window, I right clicked on the root directory, selected 'module settings', and set the JDK location. Everything's fine now.


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

...