Almost reached to solution with one issue.
on window if i give file name as same it gives error "process can not access file because it is used by another process."
but if i use difernt file name it works with exception save in another file and stdout in another file.
for linux are you sure it wont ask for second file name?as for same file name it is giving error on windows
java -jar ar.jar > a.txt 2>&1
On Windows XP, I'm not positive, but I believe you would just say
java -jar ar.jar > a.txt 2>a.txt