我正在尝试将后端端点云模块添加到我的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 = /库/爪哇/ JavaVirtualMachines / jdk1.7.0_45.jdk /内容/首页
Android Studio版本:1.1.0 Gradle版本:2.2.1
答案 0 :(得分:0)
问题在于,有一些重复的Java jar文件被yosemite install复制到/ Library / Java / Extensions中。删除jar文件并重新启动android studio修复它:
cd /Library/Java/Extensions
sudo rm -rf *.jar