简体   繁体   中英

Setting default JDK version for Android Studio Windows

I have searched and could not find a solution for this problem.

Error:Buildtools 24.0.2 requires Java 1.8 or above.  Current JDK version is 1.7.

My JAVA_HOME variable in path variable is pointing to C:\\Program Files\\Java\\jdk1.8.0_101

I don't know what I am missing and I couldn't find any settings in Android Studio to change the JDK path.

Make sure that you have proper location and version of JDK

Go to File -> Project Structure . You would see this window:

在此处输入图片说明

You can also add compileOptions in your app/build.gradle file:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM