[英]Cannot execute gradle build in eclipse
I create new Gradle project in Eclipse Luna
but when I try to execute Gradle build through the Gradle plugin in eclipse I get an error: 我在
Eclipse Luna
创建了新的Gradle项目,但是当我尝试通过Eclipse Luna
的Gradle插件执行Gradle构建时,出现错误:
FAILURE: Build failed with an exception.
失败:构建失败,发生异常。
- What went wrong: Execution failed for task ':compileJava'.
出了什么问题:任务':compileJava'的执行失败。
Cannot find System Java Compiler.
找不到系统Java编译器。 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(而不仅仅是JRE),并将JAVA_HOME系统变量配置为指向相应的目录。
The thing is JAVA_HOME
is setted and running gradle build
through the cmd is OK
. 事情是
JAVA_HOME
,并通过cmd运行gradle build
是OK
。 I create two files in the same directory where build.gradle is located, there are: gradle.properties
: 我在build.gradle所在的同一目录中创建两个文件,它们是:
gradle.properties
:
org.gradle.java.home=C:/Program Files/Java/jdk1.7.0_60
and local.properties
: 和
local.properties
:
org.gradle.java.home=C:/Program Files/Java/jdk1.7.0_60
UPD: When I try to delete and re-import that project, it works fine. UPD:当我尝试删除并重新导入该项目时,它工作正常。 When I click to the
build model
button it's also ok. 当我单击
build model
按钮时,也没问题。 But when I'm trying to execute build task, it doesn't workd. 但是,当我尝试执行构建任务时,它不起作用。
Here is how this issue can be fixed. 这是解决此问题的方法。
Here is where to update you installed JRE in eclipse. 这是在Eclipse中更新安装的JRE的位置。 As you can see I have added a jdk.
如您所见,我添加了一个jdk。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.