 <p>We can specify <strong>output</strong> attribute of the java task which will redirect your error and output streams to the file specified as the value of this attribute. Or </p> <p>You can explore the <strong>echo</strong> task in Ant through which you will be able to print the messages on the console </p> <p>More information can be found on :</p> <p><a href="https://ant.apache.org/manual/Tasks/exec.html" rel="nofollow">https://ant.apache.org/manual/Tasks/exec.html</a>. or</p> <p><a href="http://www.vogella.com/tutorials/ApacheAnt/article.html" rel="nofollow">http://www.vogella.com/tutorials/ApacheAnt/article.html</a></p>