You'll want to start the second java program using run time probably and add the output for the first command as a parameter for running the second, as from what I've tried Windows does not like piping into other programs.
Quick how-to: https://stackoverflow.com/a/8496537/3342157
Information on Runtime: http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html