I want to use runtime to execute cmdline. This command is to generate example_jtl.jtl
and example_visual
(a blank folder and new file in here) by example.jmx
. The Java code is without error after running, but there is no new file and folder. What should I do?
try {
System.out.println("begin cmd");
Runtime mt = Runtime.getRuntime();
//mt.exec("cmd \\c ionic -v");
String cmd = "cmd D:\\Programming\\JMeter\\apache-jmeter-5.5\\bin\\jmeter -n -t D:\\Programming\\JMeter\\apache-jmeter-5.5\\result\\example.jmx -l D:\\Programming\\JMeter\\apache-jmeter-5.5\\result\\example_jtl.jtl -e -o D:\\Programming\\JMeter\\apache-jmeter-5.5\\result\\example_visual";
Process pro = mt.exec(cmd);
InputStream ers= pro.getErrorStream();
pro.waitFor();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
After the program is executed, the example_jtl.jtl
file and the example_visual
folder should be generated under the /result
folder.