Android studio 运行项目`Error:Execution failed for task ':compileDebugJavaWithJavac'. > compileSdkVersion 'android-24' requires JDK 1.8 or later to compile.`

Android studio 导入项目编译ok 运行报错

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

  • 看自己 JDK版本 是不是 要求的1.8 以后 终端运行 java -version
  • 若是1.8 项目中 点击菜单 File > Project Structure 观察 JDK Location
Android studio 运行项目`Error:Execution failed for task ':compileDebugJavaWithJavac'. > compileSdkVersion 'android-24' requires JDK 1.8 or later to compile.`_第1张图片

选择 1.8版本 JDK ok

你可能感兴趣的:(Android studio 运行项目`Error:Execution failed for task ':compileDebugJavaWithJavac'. > compileSdkVersion 'android-24' requires JDK 1.8 or later to compile.`)