Gradle will not run

Hi, Gradle was working fine last week, then all of a sudden I am getting this error when I try to run any gradle build commands. The only thing I can think that has changed is I updated Java 6 to Java 7 and consequently from Apples Java implementation to Oracles. But I have that on another Mac and Gradle still runs fine. Any ideas?

Gradle Details ------------------------------------------------------------ Gradle 1.4 ------------------------------------------------------------

Gradle build time: Monday, 28 January 2013 3:42:46 AM UTC Groovy: 1.8.6 Ant: Apache Ant™ version 1.8.4 compiled on May 22 2012 Ivy: 2.2.0 JVM: 1.7.0_13 (Oracle Corporation 23.7-b01) OS: Mac OS X 10.8.2 x86_64




at org.eclipse.jface.operation.ModalContext$ Caused by: org.eclipse.core.runtime.CoreException: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at Please read below process output to find out more: ----------------------- log4j:WARN No appenders could be found for logger (org.gradle.launcher.daemon.bootstrap.DaemonMain). log4j:WARN Please initialize the log4j system properly.

at org.springsource.ide.eclipse.gradle.core.GradleModelProvider$GroupedModelProvider.ensureModels(

at org.springsource.ide.eclipse.gradle.core.GradleProject.getGradleModel(

at org.springsource.ide.eclipse.gradle.core.GradleProject.getSkeletalGradleModel(

at org.springsource.ide.eclipse.gradle.ui.wizards.GradleImportWizardPageOne$11.doit(


… 1 more Caused by: org.gradle.tooling.GradleConnectionException: Could not fetch model of type ‘HierarchicalEclipseProject’ using Gradle distribution ‘’.

at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(

at org.gradle.tooling.internal.consumer.async.DefaultAsyncConnection$

at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$

at java.util.concurrent.ThreadPoolExecutor.runWorker(

at java.util.concurrent.ThreadPoolExecutor$


This is what is in the log file under ~/.gradle/daemon/1.4/daemon-*.log

FAILURE: Build aborted because of an internal error.

  • What went wrong: Build aborted because of an unexpected internal error. Please file an issue at:

  • Try: Run with --debug option to get additional debug info.

  • Exception is: java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext

at org.gradle.logging.internal.logback.LogbackLoggingConfigurer.doFailSafeConfiguration(

at org.gradle.logging.internal.logback.LogbackLoggingConfigurer.configure(

at org.gradle.logging.internal.DefaultLoggingConfigurer.configure(

at org.gradle.logging.internal.LoggingSystemAdapter.setLevel(

at org.gradle.logging.internal.LoggingSystemAdapter.on(

at org.gradle.logging.internal.DefaultLoggingManager$StartableLoggingSystem.start(

at org.gradle.logging.internal.DefaultLoggingManager.start(

at org.gradle.logging.internal.DefaultLoggingManager.start(

at org.gradle.launcher.daemon.bootstrap.DaemonMain.initialiseLogging(

at org.gradle.launcher.daemon.bootstrap.DaemonMain.doAction(


at org.gradle.launcher.daemon.bootstrap.DaemonMain.main(

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(

at sun.reflect.DelegatingMethodAccessorImpl.invoke(

at java.lang.reflect.Method.invoke(

at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(


at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(

Daemon vm is shutting down… The daemon has exited normally or was terminated in response to a user interrupt.


It’s likely you’ve installed something that has either modified your JDK installation, or has messed with your ‘JAVA_OPTS’ env var.

Given that you are running from Eclipse, it could be a change in Eclipse that is causing Gradle to be run with a different environment. Do you get the same error when running Gradle directly?

Hey Luke, thanks for that. Below is the part of the log that shows all the env variables. Is there anything in there that looks suspicious?

10:49:44.736 [INFO] [org.gradle.launcher.daemon.client.DefaultDaemonConnector] Starting Gradle daemon 10:49:44.755 [DEBUG] [org.gradle.launcher.daemon.client.DefaultDaemonStarter] Using daemon opts: [-Xms128m, -Xmx256m, -Dfile.encoding=UTF-8] 10:49:44.757 [INFO] [org.gradle.launcher.daemon.client.DefaultDaemonStarter] Starting daemon process: workingDir = /Users/gman/.gradle/daemon/1.4, daemonArgs: [/Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/bin/java, -Xms128m, -Xmx256m, -Dfile.encoding=UTF-8, -cp, /Volumes/Maestro/Work/Tools/gradle-1.4/lib/gradle-launcher-1.4.jar, org.gradle.launcher.daemon.bootstrap.GradleDaemon, 1.4, /Users/gman/.gradle/daemon, 10800000, ec73ee4a-f892-4cb0-9391-3d0c4eaf23d5, -Xms128m, -Xmx256m, -Dfile.encoding=UTF-8] 10:49:44.777 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process ‘Gradle build daemon’. Working directory: /Users/gman/.gradle/daemon/1.4 Command: /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/bin/java -Xms128m -Xmx256m -Dfile.encoding=UTF-8 -cp /Volumes/Maestro/Work/Tools/gradle-1.4/lib/gradle-launcher-1.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 1.4 /Users/gman/.gradle/daemon 10800000 ec73ee4a-f892-4cb0-9391-3d0c4eaf23d5 -Xms128m -Xmx256m -Dfile.encoding=UTF-8 10:49:44.778 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Environment for process ‘Gradle build daemon’: {OLDPWD=/Volumes/Maestro/Work/Tools/gradle-1.4, TERM=xterm-256color, SHELL=/bin/bash, TMPDIR=/var/folders/qf/0k6jylyn3s9_20xzkg53l6r40000gn/T/, TERM_PROGRAM_VERSION=309, SHLVL=1, APP_ICON_82894=/Volumes/Maestro/Work/Tools/gradle-1.4/media/gradle.icns, __CF_USER_TEXT_ENCODING=0x1F5:0:0, TERM_PROGRAM=Apple_Terminal, PATH=/opt/local/bin:/opt/local/sbin:/Volumes/Maestro/Work/Tools/gradle-1.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin, COMMAND_MODE=unix2003, APP_NAME_82894=Gradle, DISPLAY=/tmp/launch-G2aXKE/org.macosforge.xquartz:0, USER=gman, JAVA_MAIN_CLASS_82894=org.gradle.launcher.GradleMain,, JAVA_OPTS=-Djava.ext.dirs=, PWD=/Users/gman, JAVA_ARCH=x86_64, TERM_SESSION_ID=98DB1333-B1C7-45AF-B72C-DB3C50482876, HOME=/Users/gman, LOGNAME=gman, Apple_Ubiquity_Message=/tmp/launch-njUL6t/Apple_Ubiquity_Message, Apple_PubSub_Socket_Render=/tmp/launch-9HWfST/Render, SSH_AUTH_SOCK=/tmp/launch-9CTBob/Listeners, LANG=en_AU.UTF-8}

‘-Djava.ext.dirs=,’ looks pretty suspicious.

That shouldn’t cause a problem on its own, but it’s a red flag that something has messed with your environment (or at least I think it is).

Something may have touched your JDK install. I’d suggest comparing it with a known working version and seeing if there are any extra files in the broken one.

It looks like slf4j-log4j.jar is ending up on the classpath used to launch Gradle, conflicting with logback-classic.jar. If you haven’t added anything to the Gradle distribution’s lib directory, then the jar might be coming from something in the environment. Some options:

  • Via the ‘$GRADLE_OPTS’ or ‘$JAVA_OPTS’ environment variables * In ‘$JAVA_HOME/lib/ext’ or ‘/Library/Java/Extensions’ * Using a non-standard ‘java’ launcher in $JAVA_HOME/bin

You may get a hint if you run ‘gradle tasks --debug’ and check the output for lines like:

SLF4J: Class path contains multiple SLF4J bindings.
 SLF4J: Found binding in...

Hey guys, thanks for your help and sorry for the late reply.

I found log4j, slf4j-api and slf4j-log4j12 in /Library/Java/Extensions. I have no idea how they got there, but once I removed them gradle worked as normal.

I guess I now just wait for some other application to fall over to see who the culprit was.

Thanks again for your help.

@Graham Webber that you so much for solving my issue. New to Gradle I’ve been grappling for days trying to move and existing project across and the project dependancies setup. Got it all running on my Macbook but couldn’t get it on my iMac and your solution resolved the exact error I was seeing above. Thanks!