Apache Commons Exec API for executing exe files from java program

but it is proved that it is not an ideal solution for programs which handles IO operations and for async executables. you can find more advantages of Apache Commons Exec library over traditional API in the below link.

LogOutputStream in = new LogOutputStream() {@Overrideprotected void processLine(String line, int exitvalue) { //handle the output which was produced by the process.... System.out.println(line); }};PumpStreamHandler streamHandler = new PumpStreamHandler(in, in);

// Executing the command along with its arguments

DefaultExecutor executor = new DefaultExecutor();

//attaching the created shreamhandler to the executor...

executor.setStreamHandler(streamHandler);

// execution...executor.execute(command);

the above program executes the ping command and displays the output using the standard out.

Executing the interactive executables can be found in the below link...