In a script, according to the ANT configuration, you can redirect the output of the Java program to the standard output, and the probably the script is as follows:
#! / bin / sh
X = `ls / home / qianglee / mail / lib / *. jar`
x = `Echo $ x | Sed -E 'S / /: / G'`
Echo $ x
Java-cp $ x: $ classpath com.lj.maillisten 1 >> ./ MailerRor.log 2 >> ./mailout.log >> ./mailtmp.log
#java -cp $ x: $ classpath com.lj.maillisten >> ./ Mailistener.log
#java -cp $ x: $ classpath com.lj.prasemimeMessage >> ./ Mailistener.log
1 is the standard error, 2 is the standard output