How to specify the JDK version in android studio?

前端 未结 5 1049
青春惊慌失措
青春惊慌失措 2020-11-28 06:48

Android Studio is giving me a Gradle build error that looks like this:

Error:(3, 22) compileSdkVersion android-22 requires compiling with JDK 7
5条回答
  •  我在风中等你
    2020-11-28 07:33

    You can use cmd + ; for Mac or Ctrl + Alt + Shift + S for Windows/Linux to pull up the Project Structure dialog. In there, you can set the JDK location as well as the Android SDK location.

    Project Structure Dialog

    To get your JDK location, run /usr/libexec/java_home -v 1.7 in terminal. Send 1.7 for Java 7 or 1.8 for Java 8.

提交回复
热议问题