ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <>
Subject Re: [PATCH] - Problems running javac on Windows
Date Tue, 19 Sep 2000 20:42:47 GMT
----- Original Message -----
From: "Stefan Bodewig" <>
To: <>
Sent: Tuesday, September 19, 2000 10:30 AM
Subject: Re: [PATCH] - Problems running javac on Windows

> >>>>> "DW" == Dirk Weigenand <> writes:
>  DW> Is it really necessary to bind the trigger to the number of
>  DW> arguments rahter to the combined length of them?
> It depends.
> We first found that Runtime.exec() is going to fail on Windows at
> about 300 elements in the args array. If we want to restrict the
> trigger to depend on the length of the command line this would have to
> be rather short (as 300 times would already be too long).

I don't know who found this, but I don't think this was a problem with the
number of arguments. I did some research and here are the figures:

On Windows (98SE, NT4.0 SP6a and W2K SP0) the max. length of command line
was 32k for me if the command is executed directly thru exec() (or whatever
the JVM is using in Runtime....exec()). If a changedir is required (and Ant
uses cmd.exe for this) the Limit is going down to about 4000 Bytes. It's no
problem to feed all of these with an exec-command which uses 6000 Arguments
(also these must be really short :-) ).

On AIX 4.3 using JDK 1.1.6 the limit seems to be a length of about 24k
(subtract your environment space) or a max. of of about 5800 arguments.

On Linux the maximum is (as Stefan already wrote) above 100k (127000 was the
largest I tried) or 31201 arguments.

The POSIX limit seems to be 4096 Bytes (limits.h on AIX 4.3 states something
like this).

So in general the number of arguments seems not to be a real problem,
problems just rise if these arguments are very long and the total length of
arg-space is exceeded.

I don't know what we could do for UNIX, to be really safe it would be a
possible solution to set the Limit to 4096, inspect the properties of the VM
and if it's known that the current OS can handle larger numbers use them.

Don't know if Novell and/or AS/400 also include javac and/or if ant
would/should be used on these?


View raw message