Demond Demond - 2 months ago 17
Android Question

Execution failed 'android-24' requires JDK 1.8 or later to compile

My build keeps failing and I am not able to run a hello world app in the console or with the AVD.

Also, I'm not sure how you would setup the JUnit testing with Android Studio

I have JDK 1.8 installed

I have JDK 1.8 installed

But, This is what happens in Android Studio

This is what happens in Android Studio

Answer

You can use Ctrl + Alt + Shift + S for Windows/Linux to pull up the "Project Structure" dialog. In there, you can set the JDK location as well as the Android SDK location.

enter image description here

To get your JDK location, run /usr/libexec/java_home -v 1.8 in terminal