Can you run the batch file outside of Ant from the command line without the process hanging?
Do you have echo turned on or off in the Batch file? I don't use a Windows system, so I don't know if the commands echo if echo is on. However, you sound like you're pretty sure that its the Java task that's dying or hanging. Maybe you could run the Java profiler (-Xprof) option? It could be a memory problem with Ant not giving enough memory to the Java process. Remember that Ant, exec, and your Java process are all running in the same memory footprint. Ant, by default, only runs under 64mb. You can use the ANT_OPTS environment variable to set Ant to run with more memory (ANT_OPTS=-Xmx512m for example). See if that helps. I know that Windows doesn't seem to support "spawn" in the <exec> task. Have you tried the <java> task if you're just running a Java program anyway? You might have more luck with that. On Fri, Aug 14, 2009 at 9:11 PM, Scott Stark <[email protected]> wrote: > Hi David, thank you kindly for the pointer about running batch files on > Windows. However, I get the same results when running my build file from the > command line: the batch file executes (and starts the java process), but > never returns control to the build file, so I have to hit control-C to exit > the batch file. > > <exec executable="cmd" > failonerror="${failonerror}" > failifexecutionfails="${failifexecutionfails}" > > dir="${VCC_CBU_ICdir_root}"> > <arg value="/c"/> > <arg value="${VCC_CBU_ICdir_root}${file.separator}IC_start.bat"/> > </exec> > > > Does this sound like something is going on in the batch file? Perhaps it's > looping or something... > > Scott > > > [image: Inactive hide details for David Weintraub <[email protected]>]David > Weintraub <[email protected]> > > > > > You need to read the section about the <exec> task for Windows users. > > You cannot execute a Batch command directly. You have to call > > command.exe and use the /c parameter. > > > > > > > -- David Weintraub [email protected]
