Android Studio: Failed to complete Gradle execution. Supplied JAVA_HOME is not a valid folder

So I recently upgraded from Java 7 to Java 8, when I opened Android Studio, the below message popped up

Failed to complete Gradle execution.
Supplied JAVA_HOME is not a valid folder. You supplied /usr/lib/jvm/java-7-oracle

I was like, “what the heck!” since I already had changed my JAVA_HOME environment variable…





Turns out I also needed to change the JDK location in the Project Structure itself of Android Studio.

To change the location

  1. Open Android Studio
  2. Right Click the root of your project
  3. Click Open Module Settings
  4. On the left column, choose SDK Location
  5. Under JDK Location heading type your new Java location, in my case /usr/lib/jvm/java-8-oracle
  6. Click OK button and you should be able to continue developing

By the way, same steps for Windows and OSX

Have good and clean fun!!

Esau Silva
Software Engineer at Region One ESC
Microsoft Full Stack Application Developer
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed.
Share