sonarRunner issue with 2.2-20140910134745+0000

I know you are in the process of fixing sonarRunner with Gradle 2.2 so this may be too early to report. I’m seeing the following when I do “gradlew sonarRunner” using gradle nightly 2.2-20140910134745+0000

        ... 1 more
Caused by: Cannot run program "C:\Program Files\Java\jdk1.7.0_67\bin\java.exe" (in directory "J:\git\gradledemo\access"): CreateProcess error=206, The filename or extension is too long
        at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(
        ... 4 more
Caused by: CreateProcess error=206, The filename or extension is too long

Full stacktrace here

I suspect it may not like like the space in “C:\Program Files”? I could always install java somewhere else, but I thought this would be worth fighting through since it is the default location Oracle specifies on setup.

This is my first attempt at using Sonar in quite some time so it is quite possible there is a configuration issue on my part as well. The relevant part of my build.gradle:

apply plugin: 'sonar-runner'
sonarRunner {
    sonarProperties {
        property "", "http://localhost:9000/"
        property "sonar.jdbc.url", "jdbc:h2:tcp://localhost:9092/sonar"
        property "sonar.jdbc.driverClassName", "org.h2.Driver"
       property "sonar.jdbc.username", "sonar"
        property "sonar.jdbc.password", "sonar"

Hi Brad,

These types of early reports are very useful. Thank you.

Is suspect that the actual command line invocation to start the process is too long for Windows.

Could you try moving your Gradle project to the root of C: drive, and also running with ‘-g c:/.gradle’ temporarily. The goal here is to shorten the paths to see if this fixes the problem. If it does we know that’s the problem.

Hi Luke,

I moved my project to “C:\a” and ran with -g c:/.gradle.

C:\a>gradlew sonarRunner -g c:/.gradle

It is still failing as before.

I should have mentioned that I also tried setting JAVA_HOME to the DOS ‘dir /x’ short path


but it still appears to be using the “long” java directory instead - as I still see “C:\Program Files\Java\jdk1.7.0_67\bin\java.exe” in the stacktrace.


Can you please run with ‘–info’ and provde the output. I need to see the full command that it’s using to launch the runner.

It looks like the runner command-line is an astounding ~200K long!

Output with --info is here

Hey Bradley, I can confirm the problem. thanks for the report. I’ve raised for this.


I’ve fixed this on master. It should be in the next nightly. If you could try it out and let us know that would be very helpful.


Hi Luke,

This problem is fixed now. Nice work.

Thank you, Brad

Thanks for letting us know Brad.