android studio 2.1 java 8,Android Studio 2.2。预览1错误:“请使用JDK 8或更高版本”;...

On trying to run Android Studio 2.2 Preview 1, it gives the following error on gradle build:

Error:Please use JDK 8 or newer.

If I try and do it from the console it says:

FAILURE: Build failed with an exception.

Where: Build file 'C:\Coding\Android projects\MaterialScrollBar\app\build.gradle' line: 1

What went wrong: A problem occurred evaluating project ':app'.

com/android/jack/api/ConfigNotSupportedException : Unsupported major.minor version 52.0

I've tried to change the JDK as it suggests from jdk 1.7 to 1.8, but each time I change the JDK location for the project to any other path than the one it currently has it resets back immediately. Even if I change it to other versions of 1.7 it won't change.

I've verified that the environmental variables all point to 1.8 and still no dice. AS 2.1 recognises the JDK as 1.8 for the same project.

解决方案

I ran into this issue with a previous version of Android Studio. When I first installed Android Studio I was able to reference JDK 7 in my Program Files directory.

When I upgraded Android Studio and tried to update it to point to JDK 8, which was also in my Program Files directory, I got the same behavior you are seeing. The new path never took and it still used JDK 7.

Turns out Android Studio does not like spaces in the paths to the Android SDK and the JDK. Installing the JDK in a location that does not contain any spaces allowed me to update the location through the Project Structure window.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值