'android-24'需要JDK 1.8或更高版本进行编译 [英] 'android-24' requires JDK 1.8 or later to compile
问题描述
我使用的是Android Studio,最近收到了错误消息:
I use Android Studio and recently got the error:
错误:任务':app:compileDebugJavaWithJavac'的执行失败. compileSdkVersion'android-24'需要JDK 1.8或更高版本进行编译.
Error:Execution failed for task ':app:compileDebugJavaWithJavac'. compileSdkVersion 'android-24' requires JDK 1.8 or later to compile.
但是我已经安装了JDK 1.8:
But I have JDK 1.8 installed already:
:\ Users ..> java -version
Java版本"1.8.0_91" Java(TM)SE运行时
环境(内部版本1.8.0_91-b15)Java HotSpot(TM)64位服务器VM
(版本25.91-b15,混合模式)
:\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)
如何解决?谢谢
推荐答案
在Android Studio中打开:
File
> Project Structure
>查看JDK位置是否指向您的JDK 1.8目录.
In Android Studio open:
File
> Project Structure
> see if JDK location points to your JDK 1.8 directory.
注意:您可以使用compileSdkVersion 24
这篇关于'android-24'需要JDK 1.8或更高版本进行编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!