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

后端 未结 8 2097
轮回少年
轮回少年 2021-02-01 00:12

I use Android Studio and recently got the error:

Error:Execution failed for task \':app:compileDebugJavaWithJavac\'. compileSdkVersion \'android-24\' re

8条回答
  •  不思量自难忘°
    2021-02-01 00:46

    On Windows 10, I first checked Project Structure and it pointed to an old 1.7 jdk. I closed Android Studio then renamed the old jdks (and jre libraries for consistency) leaving the newest 1.8 library alone. When I restarted Android Studio and attempted to build the application it asked me for the Java JDK library and I gave the path to the newest 1.8 JDK library. On my system it was C:\Program Files\Java\jdk1.8.0_112.

提交回复
热议问题