I want to execute below command from java program .
java -jar jarfile.jar -dir C:/MyDirectory -out C:/MyDirectory/example.html
I tried following , but its opening cmd prompt , but it not executing next command
Runtime rt = Runtime.getRuntime();
try {
rt.exec(new String[] { "cmd.exe", "/c", "start" , "java -jar exampleJar.jar -dir C:\\MyDirectory -out C:\\MyDirectory\\exampleHtml.html" });
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}