Saturday, March 17, 2018

java - 'android-24' requires JDK 1.8 or later to compile



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


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


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...