Reputation: 443
I am trying to execute jmeter script from java program but i am getting below error
java.io.IOException: Cannot run program "D:\apache-jmeter-5.6\apache-jmeter-5.6\bin\jmeter": CreateProcess error=193, %1 is not a valid Win32 application
code:-
String jmeterPath = "D:\\apache-jmeter-5.6\\apache-jmeter-5.6\\bin\\jmeter";
String jmeterScript = "D:\\CEBA_Recording\\Create_Complaints\\Create_Complaint_n_Resolve_BOS.jmx";
String[] cmd= {jmeterPath, "-n", "-t", jmeterScript};
Process process = Runtime.getRuntime().exec(cmd);
process.waitFor();
I have set the path environment variable to jmeter/bin ,JMETER_HOME to jmeter folder but still the issue is not resolved, java version i am using is "11.0.18" 2023-01-17 LTS
Upvotes: 0
Views: 30
Reputation: 2772
jmeter
is a Unix shell script, if you're running JMeter on Windows you should use [jmeter.bat][2]
instead
Also it's possible to kick off the test using StandardJMeterEngine JMeter API class, see JMeter Command Line Overview: 5 Ways To Launch a Test article for more details
Upvotes: 1