Suppose you are creating a exe files from you jar files.
So while running how to trace the output of application.
Here i am putting very small code to do so.
The idea behind this is make a object of process and execute a exe from runtime object.
get a inputstream reader from process.
Then trace the output.
Just see below.
* Program for tracing a output from a executable
* Copyright 2009 @ yuvadeveloper
* Code By:-
public static void main(String as)
//pass the name of your exe in place of my.exe
Process p = Runtime.getRuntime().exec("DicomViewer.exe");
//getting inputstream reader from process
BufferedReader reader = new BufferedReader(new
String line = reader.readLine();
while (line != null)
line = reader.readLine();
catch (Exception e)