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
- Open Android Studio
- Right Click the root of your project
- Click Open Module Settings
- On the left column, choose SDK Location
- Under JDK Location heading type your new Java location, in my case /usr/lib/jvm/java-8-oracle
- 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!!
Thank you for this info! I was having the same exact problem and this only took 30 seconds to fix!
Glad is was helpful!!
Thank you ! you saved me a big time 🙂
Glad I was able to help!
Thanks! Very helpful hint and a big time saver.
You are welcome
This worked
Great, glad I was able to help!!