CreateProcess的错误= 206,文件名或扩展名是太长

CreateProcess的错误= 206,文件名或扩展名是太长

问题描述:

我想的呼叫 FindBugs的透过 Ant的,但收到此错误:

I'm trying to call Findbugs via Ant, but receiving this error:

Cannot run program "C:\Program Files (x86)\Java\jre6\bin\javaw.exe" (in 
directory "H:\Users\MyName\workspace\MyProject"): 
CreateProcess error=206, The filename or extension is too long

我该如何解决这个问题? o.O

How can I fix this? o.O

我有同样的问题。
我用

I had the same problem. I used

<fileset dir="${basedir}/build">
  <include name="**/*.class"/>
</fileset>

FindBugs的目标内,似乎有太多的.class文件传递到findbug(?通过命令行?),因为当我用

inside findbugs target and it seems that there is too much .class files to be passed to findbug (?via command line?) because when I used

<fileset dir="${basedir}/build/com/domain/package">
  <include name="**/*.class"/>
</fileset>

这有低数量的类,错误就消失了。

that had low number of classes, the error was gone.

于是,我通过使一个JAR文件,并将其输送到FindBugs的以

So, I solved the problem by making one jar file and feeding it to findbugs target with

<findbugs home="${findbugs.home}">
  ...
  <class location="${basedir}/targets/classes-to-analyze.jar"/>
</findbugs>