How can I see the standard output of a Java task?

I have a java program to run, and it will print some messages on the console. When I put the program in the Ant java task, I cannot see my output on the console. What should I do?

I must add that I am running Ant from Eclipse. The console output does not appear in the Eclipse console.

+4
source share
3 answers

Ant The java task does not block the standard output of a Java application unless you have configured the output attribute. Can you show what's in your build file? I suspect that you either spelled the build file incorrectly, or did Ant incorrectly. Please explain how you tried to run the application, and whether your application displays output to the console if it is launched via java at the command line.

+2
source

You need to specify the output attribute of the java task. This will redirect your errors and output streams to the file specified as the value of this attribute.

+1
source

Perhaps you used spawn="true" (Not to be confused with fork="true" , see the documentation )?

+1
source

All Articles