To get started with JMeter, the very first thing we need to do is setup and installation JMeter. In this post, I will help you how to do it.
The Apache JMeter™ application is open source software, a 100% pure Java application. So you can run JMeter from any Java-compatible OS, as long as Java has been installed on that OS (Linux, Windows, MacOS, …).
1. Setup
- Check whether Java is installed on the computer
Open Terminal
on MacOS or cmd
on Windows, type the command:
java -version
If you see the information like below:
java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
So you can skip it and go to next section 2. Download and Install JMeter now.
Otherwise, if you see this on Window
'java' is not recognized as an internal or external command, operable program or batch file
or something like this on MacOS
-bash: java: command not found
Please continue to read this step…
Go to this site, download and install the latest version of Java (now it’s Java 9, support JMeter 4.0 or higher).
For Windows users, you need to do one more thing, that’s config Environment Variable for Java Installation, follow this article will help you how to do this.
Now go back to the command above, let check the java -version
again, to make sure it displays the information of Java version, which let you know you installed Java correctly.
2. Download and Install JMeter
Please do the following steps:
- Go to this page: http://jmeter.apache.org/download_jmeter.cgi
- Download apache-jmeter-x.x.zip under Binaries section.
At the time of my post, it’s version 3.1, so I need to download the file apache-jmeter-3.1.zip - Unzip your downloaded file. You will have the folder like below
Now focus on your OS…
Windows:
– Go to /bin
folder
– Find the jmeter.bat
file (if you don’t see the .bat
extension, you can observe the Type column of the file, it should be Windows Batch File)
– Double click on this file
– JMeter UI will appear
Congratulation! You’re all set. Now you can start to use JMeter, let try to create a Basic Web Test Plan with JMeter.
MacOS/Linux:
On MacOS, it’s a little bit different compared with Window. You need to run the JMeter via command line.
– Open Terminal app, use cd
command to go to /bin
folder of JMeter
For example I just extract the JMeter folder here /Users/user/Desktop/apache-jmeter-3.1
, so I will cd
to /bin
folder via this command
cd /Users/user/Desktop/apache-jmeter-3.1/bin
– Then, type this comment
sh ./jmeter.sh
- The JMeter UI should appear like below
Congratulation! You’re all set. Now you can start to use JMeter, let try to create a Basic Web Test Plan with JMeter.
After doing all steps above, if you’re still facing any issue or problem with launching JMeter, please feel free to leave the comment below, I will try to help you.
You all can refer List of my all posts about JMeter here.
Hi,
Thank you for this helpful article. I’m having some trouble running jmeter commands in the cmd. I am trying to set the host and port with the -H and -P commands, but i am getting a message saying that the command isn’t recognized (the -H and -P commands, that is). Can you think of any reason why this might be the case?
Thanks,
Taylor Brown
LikeLike