Thursday, August 28, 2008

Ant, JavaDoc, and CreateProcess error=87

I've been developing an Ant build file for a large-ish base of existing code. I've been using my Mac as the primary devleopment platform, but the ultimate target (for the other developers) is Windows. My task to build the javadocs runs fine on OS X, but the first time I rant it on Windows, I got the following:

c:\demo\build.xml:180: Javadoc failed: java.io.IOException: Cannot run program "c:\Program Files\Java\jdk1.6.0\bin\javadoc.exe": CreateProcess error=87, The parameter is incorrect

After about 10 minutes of Googling, I found a/the simple solution: add the useexternalfile attribute to the javadoc task in Ant. Voila , back in business, on the PC at least, and it didn't seem to break the build on the Mac.

Charles.

9 comments:

Mamie said...

Hi, this is not really a comment about this article...
I think you mean "voila" when you said "viola".
take care, "viola" mean "raped" ^^

Dan said...

This fixed my problem - Thanks.

Charles Anderson said...

Thanks, mamie. That was an unintentional typo, although sometimes in speech I say "viola" as a gag. Maybe I've been using that so long that it's made it into my typing subconscious.

Stefan Baramov said...

Worked like a charm. Thanks a lot.

jmrlegido said...

Only a comment. The cause of the error is a too long sentence sent to the task. Just adding useexternalfile="yes" fixes it.

Ravikanth said...

This fixed my problem as well.....thanks

Nick said...

This fixed my problem as well...thanks for posting.

HUE said...

Thank you. Worked like a charm.

Mohammad Shirajuddin said...

Fixed my problem. Thanks a lot