Installing Apache JMeter in Windows XP

Wednesday, March 17, 2010 by Tushar Joshi
This article contains following topics:

  • Prerequisites for installing Apache JMeter
  • How to install Apache JMeter?
  • How to start Apache JMeter?

Prerequisites for installing Apache JMeter


Apache JMeter is a utility based on Java.  We need Java runtime already installed to use Apache JMeter.  After confirming that our Windows XP system has proper Java runtime installed we can proceed for installing Apache JMeter.

For checking whether we have Java runtime installed we can follow one of the methods given here.  The second method given on that page is the easiest and that is opening a command prompt and typing the command:

java -version

If the command works Java is installed and you will also know the version of Java.

Apache JMeter runs on a fully compliant JVM 1.4 or higher. (It is found that some early versions of Java 1.5 below update 7 do not recognize some JVM switches and hence the jmeter.bat script file needs some changes to run JMeter, described at the end of post).

Steps for installing Apache JMeter

The Apache JMeter Home page contains links for downloads.  When we visit Apache JMeter home page the Apache Jakarta project symbol of a bird feather can be seen with introduction to JMeter.



As shown in the image below we have to select the Download Releases link from the home page.


The download page presents many options for download.  Usually the suggested mirror is the best mirror but we can choose another one if the suggested mirror gives error or seems slow.  For just using the tool we need only the binary release.  The screen below shows the version current at the time of writing this article.  The TGZ version of the binary is relatively smallest in size.  Click on that link and save the download when prompted by the browser.

Alternatively you can click on the ZIP version given below and use any standard UNZIP utility to extract the files.


I have saved the TGZ file and extracted the contents by using 7Zip utility for windows.  After extracting the TGZ file we get a folder named jakarta-jmeter-n.n.n, where n.n.n is the version number which we downloaded.

The executable script for Apache JMeter is located in the bin directory.


The screen below shows all the contents of the jmeter bin folder.

Starting Apache JMeter tool


The executable script for Windows platform is jmeter.bat for Linux systems it will be jmeter.sh
These scripts are used to start JMeter in GUI mode.  Let us double click the jmeter.bat script to start the tool.


Double clicking the jmeter.bat file will start one command prompt and the JMeter utility in GUI mode, as shown below.  The command prompt is tied with the GUI and hence cannot be closed.  If the command prompt is closed the GUI will terminate.  We can keep the command prompt minimized while working with JMeter GUI.  The command prompt is useful in viewing any JMeter exceptions that may occur.


We saw how to download, install and start the Apache JMeter utility.

NOTE: Although Apache JMeter can run on any fully compliant Java version above Java 1.4 (It is found that some early versions of Java 1.5 below update 7 do not recognize some JVM switches and hence the jmeter.bat script file needs some changes to run JMeter.  If you happen to have early Java 1.5 version below update 7 then you may get error when double clicking the jmeter.bat file.  The error can be fixed by commenting line "set DUMP=-XX:+HeapDumpOnOutOfMemoryError" in the jmeter.bat file.  Open the jmeter.bat file by right clicking and choosing Edit option.  add REM before that line and you are ready to go.

Reference:
1) http://jakarta.apache.org/jmeter/usermanual/get-started.html#install

Thanks for reading.

with regards
JMeter-Expert Blog Team
Posted in | 23 Comments »

23 comments:

leeand00 said...

I wrote an article a little while back on my blog here about JMeter:

http://leeand00.tiddlyspot.com/#[[Testing%20With%20JMeter]]


First of all let me know if I have any errors in my article...and second of all...let me know if you want to use it on this blog.

Thank you,
Andrew J. Leer

harshal said...

I am using JMeter for Practice. Initailly it was running fine but in between I am not able to open the JMeter GUI and getting following exception:
java.lang.NoClassDefFoundError: org./apache/avalon/framework/context/ContextException

What is the Reason for this. I have done all the necessary setting.

testing said...

Hi,

we are using the Jmeter for our project to perform he performance testing.

we have recorded all the major scenarios that would be used in the application independently.

now we would like to run all the scenarios in one go on the application with different types of loads for each scenario.

can any one suggest how we can achieve this. need the steps to configure the multiple scenarios that can start at the same time.

Thanks in advance.

SM

FunFXLerner said...

Hi,
This is blog contains very useful information to the users who starts working on Jmeter. Thanks for that.
I have once question regarding web services testing. can we have the process of web services testing as above explanation and pictures.

Thanks in Advance....
RAM

Smita said...

Hi,
While running the .bat file , I get the following error:
Unable to access jarfile ApacheJMeter.jar
errorlevel=1
Press any key to continue . . .

The java setup looks good.

Tushar Joshi said...

Hi Smita,

Try running the command

java -jar ApacheJMeter.jar if this runs properly, then this would be a CLASSPATH issue. Ensure that your classpath has a dot "." in it.

with regards
Tushar

priyadarshi bharat said...

Hi,
i am a beginner in Jmeter and just started after installing the same from apache website,, and i got the following error on launching .bat file.

"An error occurred: can't find bundle for base org.apache.resources.message, locale en_us
errorlevel=1
Press any key to continue . . ."

Akram said...

I am getting this error while running jmeter.bat file in command prompt :

'java.exe' is not recognized as an internal or external command,
operable program or batch file.
errorlevel=9009
Press any key to continue . . .

Abhishek said...

Even I am getting same error.
I have used jmeter on XP, but on Windows7 it is giving an error.

kavitha said...

Hi, I too got a error that
Unable to access jar file
Error level l=1
and i tryed as Joshi said in java cmd its also saying the same PLS can any one help me

Thanks in Advance

Tushar Joshi said...

People mentioning about errors while running JMeter should also mention the version of JMeter they are using, the version of the Java they are using and also the Operating system they are using which will be necessary to figure out what may be the problem.

Also mention the output of java -version as seen on a command line on their machines.

Last but not least point is to get more rapid answers users should join the JMeter users mailing list and ask questions there so they get answers quickly.

with regards
Tushar

kavitha said...

Apache jmeter-2.7.tgz
Version of java is Java(TM)6 update21
and im using window xp

i downloaded 4m dis and said above i opened jmeter.bat

i got a error displaying
unable to access jarfile ApacheJMeter.jar
errorlevel=1

vijay ms said...

Hi i'm getting below error when i run jmeter bat file. The Java version that i have installed is JAVA_VERSION="1.7.0"

'java.exe' is not recognized as an internal or external command,
operable program or batch file.
errorlevel=9009
Press any key to continue . . .

Please let me know how to resolve this problem.
Thanks
Vijay

Ina said...

if java.exe can not be found, edit the jmeter.bat and insert the complete path to java
e.g.

if .%JM_LAUNCH% == . set JM_LAUNCH="C:\Program Files (x86)\Java\jre7\bin\javaw.exe"

Pratibha said...

I am not getting proper window of google.com.It comes with dark blue colour.

Could you please help me to make a test plan for log in on gmail.com

Dzmitry said...

Good manual for those, who are new to JMeter.
Let me suggest a set of JMeter articles and how-to's
http://blazemeter.com/blog
http://community.blazemeter.com/knowledgebase/topics/10018-jmeter-tutorials

Ravi S Singh said...

If getting the below error
'java.exe' is not recognized as an internal or external command
the solution is edit jmeter.bat as follows
if .%JM_LAUNCH% == . set JM_LAUNCH="C:\Program Files (x86)\Java\jre6\bin\javaw.exe"

Vishwas said...

Thanks.. it is working...

Kingsly Bose said...

Thanks a lot.
The good startup!

sele rao said...

It is quite informative post.
Thank you.

rajeshdas said...

Excellent post

ranjan roy said...

Thanks

manideepak@bphc said...

Hi.Very nice blog about jmeter.can u also explain how to do coding using jmeter jar files?(like writing a java code which will run jmeter)

Post a Comment