To begin with JMeter we will need to download and install its latest production release. The release contains all of the files you need to build and run most types of tests, e.g. Web (HTTP/HTTPS), FTP, JDBC, LDAP, Java, and JUnit.
Requirements
Operating Systems - JMeter has been tested and works under Unix (Solaris, Linux, etc) and Windows (98, NT, 2000, XP). Also works on OpenVMS. JMeter is a 100% Java application and should run correctly on any system that has a compliant Java implementation.
Java Version - JMeter requires a fully compliant JVM 6 or higher. Because JMeter uses only standard Java APIs, please do not file bug reports if your JRE fails to run JMeter because of JRE implementation issues.
Optional Packages
If you plan on doing JMeter development, then you will need one or more optional packages
Java Compiler - to build the JMeter source or develop JMeter plugins
SAX XML Parser - JMeter comes with Apache's Xerces XML parser. To use third party parser include its classes in JMeter's classpath and update the jmeter.properties file with the full classname of the parser implementation.
SSL Encryption - To test a web server using SSL encryption (HTTPS), JMeter requires that an implementation of SSL be provided, as is the case with Sun Java 1.4 and above. If your version of Java does not include SSL support, then it is possible to add an external implementation. Include the necessary encryption packages in JMeter's classpath . Also, update system.properties to register the SSL Provider.
JDBC Driver - to do JDBC testing you will need to add your database vendor's JDBC driver to the classpath.
Running JMeter
To run JMeter, run the jmeter.bat (for Windows) or jmeter (for Unix) file. These files are found in the bin directory. After a short time, the JMeter GUI should appear.
JMeter's Classpath - JMeter automatically finds classes from jars in the following directories:
JMETER_HOME/lib - used for utility jars
JMETER_HOME/lib/ext - used for JMeter components and plugins
If you have developed new JMeter components, then you should jar them and copy the jar into JMeter's lib/ext directory. JMeter will automatically find JMeter components in any jars found here. You can also install utility Jar files in $JAVA_HOME/jre/lib/ext
Note that setting the CLASSPATH environment variable will have no effect. This is because JMeter is started with "java -jar", and the java command silently ignores the CLASSPATH variable, and the -classpath/-cp options when -jar is used.
Proxy Server - To test from behind a firewall/proxy server we need to provide JMeter with the firewall/proxy server hostname and port number.
Run the jmeter[.bat] file from a command line with the following parameters:
-H [proxy server hostname or ip address]
-P [proxy server port]
-N [nonproxy hosts] (e.g. *.apache.org|localhost)
-u [username for proxy authentication - if required]
-a [password for proxy authentication - if required]
Non-GUI Mode - For non-interactive testing, you may choose to run JMeter in Non-GUI Mode. Command options in Non-GUI Mode:
-n This specifies JMeter is to run in non-gui mode
-t [name of JMX file that contains the Test Plan].
-l [name of JTL file to log sample results to].
-r Run all remote servers specified in jmeter.properties (or remote servers specified on command line by overriding properties)
The script also lets you specify the optional firewall/proxy server information:
-H [proxy server hostname or ip address]
-P [proxy server port]
Server Mode - For distributed testing , run JMeter in server mode on the remote node(s), and then control the server(s) from the GUI. You can also use non-GUI mode to run remote tests. To start the server(s), run jmeter-server[.bat] on each server host.
Overriding Properties Via The Command Line - Java system properties, JMeter properties, and logging properties can be overriden directly on the command line (instead of modifying jmeter.properties). To do so, use the following options:
-D[prop_name]=[value] - defines a java system property value.
-J[prop name]=[value] - defines a local JMeter property.
-G[prop name]=[value] - defines a JMeter property to be sent to all remote servers.
-G[propertyfile] - defines a file containing JMeter properties to be sent to all remote servers.
-L[category]=[priority] - overrides a logging setting, setting a particular category to the given priority level.
The -L flag can also be used without the category name to set the root logging level.
Logging and error messages - If JMeter detects an error during a test, a message will be written to the log file. The log file name is defined in the jmeter.properties file (or using the -j option, see below). It defaults to jmeter.log , and will be found in the directory from which JMeter was launched.
The menu Options > Log Viewer displays the log file in a bottom pane on main JMeter window.
In the GUI mode, the number of error/fatal messages logged in the log file is displayed at top-right. When running on Windows, the file may appear as just jmeter unless you have set Windows to show file extensions.