android studio tools 24,Android Studio: Buildtools 24.0.1 requires Java 1.8 or above.

本文指导如何在Mac上解决Android Studio要求Java 1.8及以上版本的问题,包括检查并更新JDK、项目设置和SDK配置。步骤包括安装Java 1.8,确认JDK版本,以及在Gradle中设置兼容性选项。
摘要由CSDN通过智能技术生成

问题

I'm trying to setup an Android dev environment on Mac.

My starting point is Java 1.7 I believe. So I installed android studio and opened the project I'd like to build. And it says:

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

So I went and download Java 1.8 u101 and installed that. No luck. Then I removed Android Studio and re-installed it and re-installed the SDK and still no luck.

My Java Control Pannel says: Java 8 update 101.

Output of /usr/bin/java:

java version "1.8.0_101"

Java(TM) SE Runtime Environment (build 1.8.0_101-b13)

Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Output of /usr/bin/javac

javac 1.8.0_101

What have I done wrong?

回答1:

Make sure your JDK Version through Project Structure

You can add this in your gradle section

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_8

targetCompatibility JavaVersion.VERSION_1_8

}

回答2:

On a Mac just double-click on the app and a new modal windows will show. Then select 'Open Module Setting' and go to 'SDK Location'.

回答3:

Click project structure -> app -> in properties change the (compile Sdk Version ) to google API's 23 . and in build tools Version = 22.0.1

来源:https://stackoverflow.com/questions/39116095/android-studio-buildtools-24-0-1-requires-java-1-8-or-above

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值