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