I am currently switching from ant to gradle for my multi module web application and at the moment it seems that the current version of Gradle (M9) might be running up agains
GRADLE_OPTS value in gradlew was set like this for me before
DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
This was causing compileJava fail like below in Jenkin
What went wrong: Execution failed for task ':compileJava'. GC overhead limit exceeded
Later I had changed DEFAULT_JVM_OPTS like below to make Jekin build success -
DEFAULT_JVM_OPTS="-Xmx512m" "-Xms64m"