Error:compileSdkVersion android-21 requires compiling with JDK 7

后端 未结 9 1287
逝去的感伤
逝去的感伤 2020-12-02 07:44

While compiling i get the error Error:compileSdkVersion android-21 requires compiling with JDK 7, saying that a newer version of JDK is required.

I\'m r

9条回答
  •  误落风尘
    2020-12-02 08:13

    1. Download from here latest JDK.
    2. Open command line tool.
    3. Copy and paste following line into your command line tool and press return.

    /usr/libexec/java_home

    1. Copy output of this command.
    2. Go back to your android project, and navigate as below

    File -> Project structure -> JDK location

    edit(click on square with three dots) JDK location(2nd in image) and paste command line tool output there.

    I have gathered these instructions using MacBook Pro.

提交回复
热议问题