ProcessBuilder pb = new ProcessBuilder(args);
pb.directory(new File(sim.getExportPath()));
Process dua = pb.start();
StreamGobbler gi = new StreamGobbler(dua.getInputStream());
StreamGobbler ge = new StreamGobbler(dua.getErrorStream());
gi.start();
ge.start();
int exitvalue = dua.waitFor();
gi.stop();
ge.stop();
List<String> gir = gi.getReadLines();
List<String> ger = ge.getReadLines();
for (String s : ger) {
System.out.println(s);
}
} catch (Exception e) {