在android studio中构建android云端点时出错:请确保已安装JDK

在android studio中构建android云端点时出错:请确保已安装JDK,android,android-studio,gradle,Android,Android Studio,Gradle,我正在尝试将后端端点云模块添加到我的android studio应用程序中,但当我尝试构建项目时,出现以下错误: Executing tasks: [:backend:compileJava, :mobile:compileDebugSources, :wear:compileDebugSources] Configuration on demand is an incubating feature. :backend:compileJava FAILED FAILURE: Build fa

我正在尝试将后端端点云模块添加到我的android studio应用程序中,但当我尝试构建项目时,出现以下错误:

Executing tasks: [:backend:compileJava, :mobile:compileDebugSources, :wear:compileDebugSources]

Configuration on demand is an incubating feature.
:backend:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':backend:compileJava'.
> Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.
我将JDK设置为1.7(项目结构>SDK位置>JDK位置:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.JDK/Contents/Home),但仍然收到此错误

我甚至试图通过将此添加到我的gradle.properties和local.properties来强制JDK定位,但没有成功: org.gradle.java.home=/Library/java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/home

Android Studio版本:1.1.0
Gradle版本:2.2.1

问题在于,yosemite安装程序将重复的java jar文件复制到/Library/java/Extensions中。删除jar文件并重新启动android studio修复了它:

cd /Library/Java/Extensions 
sudo rm -rf *.jar