'jmeter' is not recognized as an internal or external command, operable program or batch file
Asked Answered
I

5

8

When i run my JMeter script on commandline mode, i am getting below error.

But the same script is running perfectly fine on GUI mode.

Need some help here to fix this.

Below is the error:

C:\Users\Sundarapandiyan>jmeter -n -t D:\JMETER\apache-jmeter-3.1\bin\My Projects MyFirstUIRecordBadBoy.jmx -l \JMETER\apache-jmeter-3.1\bin\My Projects CSVSample_user.csv 'jmeter' is not recognized as an internal or external command, operable program or batch file.

Intelligencer answered 19/3, 2017 at 18:15 Comment(0)
D
13

As Dave L mentioned, add the Jmeter installation bin directory to the system path using My Computer > properties > Advanced System settings > Environment variables > Under system variables, select PATH > Add D:\JMETER\apache-jmeter-3.1\bin to your path at the end.

Please note, windows only considers the jmeter.bat file even when you run jmeter. It won't run the plain jmeter file available under the installation path.

Detroit answered 20/3, 2017 at 2:36 Comment(0)
L
1

To directly run a program on the command line it needs to be either included in the environment PATH; in the same folder; or specified by full path.

To use JMeter via command line you can either:

  • Add the folder containing JMeter to your PATH (see https://www.java.com/en/download/help/path.xml) for how to do this across Windows versions, it's quite generic despite saying JAVA)
  • Run it directly from the JMeter folder (in your case D:\JMETER\apache-jmeter-3.1), this is the easiest option for you.
    • You can do this by either Shift+Right Clicking in the folder & using 'Open command window here') or;
    • Changing to the directory via command line

You can change drive & directory on the command line using:

D:
cd D:\JMETER\apache-jmeter-3.1
Lethia answered 20/3, 2017 at 1:17 Comment(0)
F
1

If we have space in folder name, the path will get break and you won't be able to run the file. To overcome this, please use double quotes in the full path. Example: C:\Users\Sundarapandiyan>jmeter -n -t "D:\JMETER\apache-jmeter-3.1\bin\My Projects" MyFirstUIRecordBadBoy.jmx -l "path_to_jtl_file"

And also add complete path of jmeter. example: C:\Users\Sundarapandiyan\Jmeter_folder\bin\jmeter -n -t [rest of the command]

Flemish answered 20/3, 2017 at 8:23 Comment(0)
F
0

If you are trying to run JMeter from the command line and are getting an error message stating that “‘jmeter’ is not recognized as an internal or external command, operable program or batch file,” it means that JMeter is not in the system path and the system is unable to find it To solve this issue, you will need to add the path to the JMeter installation to the system path. Here are the steps you can follow:

  1. First, locate the installation directory for JMeter. By default, this is usually “C:\apache-jmeter-X.X\bin” (without the quotes), where X.X is the version number of JMeter
  2. Next, go to Start > Control Panel > System and Security > System
  3. Click the Advanced system settings link on the left side of the window
  4. Click the Environment Variables button
  5. Under the System variables section, scroll down and find the Path variable
  6. Click the Edit button
  7. Add the folder location to the Path env variable

Note: do not delete any existing values. In case you are using older Windows OS
Add the path to the JMeter installation to the end of the Variable value field. For example, if JMeter is installed in “C:\apache-jmeter-X.X\bin,” you would add “;C:\apache-jmeter-X.X\bin” (without the quotes) to the end of the field

  1. Click OK to save the changes After following these steps, the system should be able to find JMeter and you should be able to run it from the command line without any issues
Fizzle answered 4/1, 2023 at 7:18 Comment(0)
V
0
  1. give the bin location in environment variables in VM - self-host agent
  2. give the jmeter bin directory path in the Working Directory in the Advance section - see the image:

enter image description here

Vladikavkaz answered 12/6 at 10:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.