FindBugs plugin runs into command line length limit on Windows

(Chris Jones) #1

Similar to the mailing list thread at – I’m unable to run the findbugs task on my code due to this error in JDK 1.7:

[ant:findbugs] Cannot run program "C:\Program Files\Java\jdk1.7.0_02\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long

Or, with JDK 1.6:

[ant:findbugs] Cannot run program "C:\Program Files\Java\jdk1.6.0_21\jre\bin\java.exe": CreateProcess error=87, The parameter is incorrect

I’m using this version of gradle:

Gradle 1.0-milestone-8
  Gradle build time: Monday, February 13, 2012 11:53:32 PM UTC
Groovy: 1.8.4
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.6.0_21 (Sun Microsystems Inc. 17.0-b17)
OS: Windows 7 6.1 amd64

When I run gradle with --debug, I can extract the command it runs when it tries to start FindBugs in a new JVM. I’ve abbreviated it in two places below:

14:32:46.933 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Execute:Java13CommandLauncher: Executing 'C:\Program Files\Java\jdk1.6.0_21\jre\bin\java.exe' with arguments:
(abbreviated from 120 files to 2)'C:\Users\chris\work\PAL-CPOF-SHELL\current\tasklearning\bridge\src\com\sri\pal\;C:\Users\chris\work\PAL-CPOF-SHELL\current\tasklearning\bridge\src\com\sri\pal\'
(abbreviated from 166 files to 2)

It seems likely that this command line is simply too long for Windows to handle.

(Peter Niederwieser) #2

I’ve created GRADLE-2167 for this.

(Gradle Jira) #3

Thanks for the report. Definitely a bug we need to fix.

(Chris Jones) #4

I’m glad you’re on the case.

(Gradle Jira) #5

This issue was marked as fixed earlier today. Is the Fix Version known yet? Thanks.

(Gradle Jira) #6

This fix will be part of the next release (1.0-rc1) that will hopefully be available within the next two weeks. We’re currently working on a snapshot of this rc1 available to be tested in the field within the next days.