The latest version of Android Studio is installed. An exception occurred when I built the project?

Android project, it was good with the old version of Android Studio. But after I updated the IDE version, an exception will occur when I create a project with gradle.

Here is the problem:

Error: execution completed for task ': jellyrefresh: compileReleaseJava'.

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

The thing is, in my Windows XP environment (I don’t want to update), so I can’t install Java 8 , so I didn’t need to tell me about it. But I still want to use the latest version of Android Studio .

So what is the most resonant solution for this exception?

+5
source share
2 answers

You can open build.gradle to look, maybe you used retrolambda to compile javacode, which requires java8.

0
source

Go to File → Project Structure → SDK Location → JDK Location and change the path to Java 8 Home, and then rebuild the project.

enter image description here

Photo taken with Mac. However, it should work for others.

+17
source

All Articles