By using Java Runtime.getRuntime().exec(), you can start an external binary from JRE. If there are some outputs or errors and you don't handle them, you will face some potential problems such as buffer overflow and don't have a clue where to debug. The following class can be used to catch/process the outputs from Runtime.getRuntime().exec() class StreamReader extends Thread { Reader input; int c; char[] chars = new char[1000]; String line; String threadName; public StreamReader(String threadName, Reader input) { this.input = input; this.threadName = threadName; } public void run() { try { while ((c = input.read(chars)) != -1) { line = new String(chars, 0, c); System.out.print(threadName + " " + line); } } catch (Exception e) { System.out.println(e.getMessage()); } } } When you start the process, you can call with Process p...
Integration of Knowledge and Action (知行合一)by wandering around the world