0

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:

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':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.

The thing is JAVA_HOME is setted and running gradle build through the cmd is OK. I create two files in the same directory where build.gradle is located, there are: gradle.properties:

org.gradle.java.home=C:/Program Files/Java/jdk1.7.0_60

and 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. When I click to the build model button it's also ok. But when I'm trying to execute build task, it doesn't workd.

1
  • I am having the same problem with eclipse Luna.
    – QIKHAN
    Dec 23, 2014 at 4:08

1 Answer 1

0

Here is how this issue can be fixed.

  1. Go to Eclipse-Luna menu Windows>Prefernces
  2. Select Gradle>Arguments
  3. Update Workspace JRE : to point to a jdk instead of jre as Gradle requires jdk for code compilation.

enter image description here

Here is where to update you installed JRE in eclipse. As you can see I have added a jdk.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.