Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installed the latest version of Android Studio, Exception occurred when I built the project?

An Android project, It was good with the older version of Android Studio. But after I updated the IDE version, An exception will occured when I build the project whith gradle.

Here is the problem:

Error:Execution failed for task ':jellyrefresh:compileReleaseJava'.

When running gradle with java 5, 6 or 7, you must set the path to jdk8, either with property retrolambda.jdk or environment variable JAVA8_HOME

The thing is, my environment is Windows XP(I don't want to update), So I cannot install Java 8, so no need to tell me to do that. But I still want to use the Android Studio's latest version.

So what's the most resonable solution to this exception?

like image 671
Waylan Punch Avatar asked Sep 07 '15 05:09

Waylan Punch


1 Answers

Go to File -> Project Structure -> SDK Location -> JDK Location and change the path to Java 8 Home, then Rebuild project.

enter image description here

The snapshot was taken from Mac. However, it should work for others too.

like image 155
tausiq Avatar answered Oct 01 '22 16:10

tausiq