Index: src/main/org/apache/tools/ant/taskdefs/Jikes.java =================================================================== RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jikes.java,v retrieving revision 1.3 diff -u -r1.3 Jikes.java --- src/main/org/apache/tools/ant/taskdefs/Jikes.java 2000/07/02 16:18:55 1.3 +++ src/main/org/apache/tools/ant/taskdefs/Jikes.java 2000/07/14 02:32:47 @@ -11,7 +11,7 @@ public class Jikes { protected JikesOutputParser jop; protected String command; - + /** * Constructs a new Jikes obect. * @param jop - Parser to send jike's output to @@ -28,20 +28,29 @@ * @param args - arguments to pass to process on command line */ protected void compile(String[] args) { - String[] commandArray = new String[args.length+1]; - commandArray[0] = command; - System.arraycopy(args,0,commandArray,1,args.length); - - // We assume, that everything jikes writes goes to - // standard output, not to standard error. The option - // -Xstdout that is given to Jikes in Javac.doJikesCompile() - // should guarantee this. At least I hope so. :) try { + // Windows has a 32k limit on total arg size, so + // create a temporary file to store all the arguments + File tmpFile = File.createTempFile("jikes", null, new File(".")); + tmpFile.deleteOnExit(); + Writer out = new FileWriter(tmpFile); + for (int i = 0; i < args.length; i++) { + out.write(args[i] + "\n"); + } + out.flush(); + out.close(); + + String[] commandArray = new String[] { command, "@" + tmpFile.getName() }; + + // We assume, that everything jikes writes goes to + // standard output, not to standard error. The option + // -Xstdout that is given to Jikes in Javac.doJikesCompile() + // should guarantee this. At least I hope so. :) Process jikes = Runtime.getRuntime().exec(commandArray); BufferedReader reader = new BufferedReader(new InputStreamReader(jikes.getInputStream())); jop.parseOutput(reader); } catch (IOException e) { - throw new BuildException("Error running Jikes compiler", e); + throw new BuildException("Error running Jikes compiler", e); } } }