librelist archives

« back to archive

Re: "Argument list too long" trying to compile java code

Re: "Argument list too long" trying to compile java code

From:
Toby Crawley
Date:
2013-02-05 @ 22:19
One option may be to write all of the command-line options to a tmp
file, and use the @filename option provided by javac: 


http://docs.oracle.com/javase/6/docs/technotes/tools/windows/javac.html#commandlineargfile

 Sebastián Galkin writes:

> javac task works by calling Java compiler passing it the full
> classpath and all the java files that need compilation. The class path
> + all files could turn out to be a very large command line string, and
> it can potentially exceed the limit allowed by the OS. (I'm getting
> the error in Linux)
>
> This error doesn't happen if the list of java files to compile is
> smaller.
>
> Do you have any workarounds for this problem? Do you think that makes
> sense to send a PR splitting javac into multiple calls to the java
> compiler with a shorter file list? That would be a temporary solution,
> because very large classpaths could still exceed the command line
> limit.
>
> Thanks


-- 
Toby Crawley
http://immutant.org | http://torquebox.org