3

I've created a gradle project with the following configuration:

group '...'
version '0.0'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

test {
    useTestNG()

    beforeTest { descriptor ->
        logger.lifecycle("Running test: " + descriptor)
    }
}

When I execute "gradle build" I have the following error message:

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.

This is weird since I have $JAVA_HOME set:

✗ echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle
✗ $JAVA_HOME/bin/javac
Usage: javac <options> <source files>
where possible options include:
Ivan Mushketyk
  • 8,107
  • 7
  • 50
  • 67

1 Answers1

-6

I've found a solution.

To fix this issue I simply executed:

./gradlew build

This did the trick.

Ivan Mushketyk
  • 8,107
  • 7
  • 50
  • 67