jMeter - Environment Setup



This chapter will guide you on how to prepare an environment to start your work with jMeter. It will also teach you how to set up JDK on your machine before you set up jMeter −

Setup Java Development Kit (JDK)

You can download the latest version of SDK from Oracle's Java site − Java SE Downloads. You will find instructions for installing JDK in downloaded files, follow the given instructions to install and configure the setup. Finally set PATH and JAVA_HOME environment variables to refer to the directory that contains java and javac, typically java_install_dir/bin and java_install_dir respectively.

If you are running Windows and have installed the JDK in C:\jdk-24, you would have to put the following line in your C:\autoexec.bat file.

set PATH=C:\jdk-24;%PATH% 
set JAVA_HOME=C:\jdk-24

Alternatively, on Windows NT/2000/XP, you will have to right-click on My Computer, select Properties → Advanced → Environment Variables. Then, you will have to update the PATH value and click the OK button.

On Unix (Solaris, Linux, etc.), if the SDK is installed in /usr/local/jdk-24 and you use the C shell, you will have to put the following into your .cshrc file.

setenv PATH /usr/local/jdk-24/bin:$PATH 
setenv JAVA_HOME /usr/local/jdk-24

Alternatively, if you use an Integrated Development Environment (IDE) like Borland JBuilder, Eclipse, IntelliJ IDEA, or Sun ONE Studio, you will have to compile and run a simple program to confirm that the IDE knows where you have installed Java. Otherwise, you will have to carry out a proper setup as given in the document of the IDE.

Popular Java Editors

To write your Java programs, you need a text editor. There are many sophisticated IDEs available in the market. But for now, you can consider one of the following −

  • Notepad − On Windows machine, you can use any simple text editor like Notepad (Recommended for this tutorial), TextPad.

  • Netbeans − It is a Java IDE that is open-source and free, which can be downloaded from www.netbeans.org/index.html.

  • Eclipse − It is also a Java IDE developed by the eclipse open-source community and can be downloaded from www.eclipse.org.

Step 2: Download JMeter

Download the latest version of JMeter from https://jmeter.apache.org/download_jmeter.cgi. For this tutorial, we downloaded apache-jmeter-5.6.3 and copied it into D:\>Projects\JMeter folder.

The directory structure should look like as shown below −

  • apache-jmeter-5.6.3
  • apache-jmeter-5.6.3\bin
  • apache-jmeter-5.6.3\docs
  • apache-jmeter-5.6.3\extras
  • apache-jmeter-5.6.3\lib\
  • apache-jmeter-5.6.3\lib\ext
  • apache-jmeter-5.6.3\lib\junit
  • apache-jmeter-5.6.3\printable_docs

You can rename the parent directory (i.e. apache-jmeter-5.6.3) if you want, but do not change any of the sub-directory names.

Step 4: Run JMeter

After downloading JMeter, go to the bin directory. In this case, it is D:\Projects\jmeter\apache-jmeter-5.6.3\bin. Now click on the following −

OS Output
Windows jmeter.bat
Linux jmeter.sh
Mac jmeter.sh

After a short pause, the JMeter GUI should appear, which is a Swing application, as seen in the following screenshot −

JMeter GUI

This is the main page and the default page of the tool.

Advertisements