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…

[topads][/topads]

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!!

Spread the love

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

  1. Rob says:

    Thank you for this info! I was having the same exact problem and this only took 30 seconds to fix!

  2. Salah says:

    Thank you ! you saved me a big time 🙂

  3. Claudia says:

    Thanks! Very helpful hint and a big time saver.

  4. Karthik says:

    This worked

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.