Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I use Android Studio and recently got the error:

Error:Execution failed for task ':app:compileDebugJavaWithJavac'. compileSdkVersion 'android-24' requires JDK 1.8 or later to compile.

But I have JDK 1.8 installed already:

:Users..>java -version
java version "1.8.0_91" Java(TM) SE Runtime
Environment (build 1.8.0_91-b15) Java HotSpot(TM) 64-Bit Server VM
(build 25.91-b15, mixed mode)

How to fix it? Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
304 views
Welcome To Ask or Share your Answers For Others

1 Answer

In Android Studio open:
File > Project Structure > see if JDK location points to your JDK 1.8 directory.

Note: you can use compileSdkVersion 24


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...