Installing The Grinder on Ubuntu

Installing The Grinder

The Grinder does not include an installation script or start-up scripts for some strange reason.  You therefore need to do all of this stuff yourself. Here’s how I did it.


The only prerequisite for The Grinder is Java 1.5 or greater, but some features can only be used with Java 1.6. So let’s install Java 1.7:

$ sudo apt-get install sun-java7-jdk

Everything else that you need to run The Grinder is part of the package.

One more thing that you may want to install is the pychecker package. This tool will check your test scripts for any typos or indentation errors. Simply install it like this:

$ sudo apt-get install pychecker

It’s not required, but it can save you some big headaches later when your script fails to run.  Another more advanced alternative is to install Eclipse.  Once you have Eclipse, you’ll want to install Pydev and Grinderstone.  This will give a fully functional Grinder development environment.

Installing The Package

Since the script doesn’t have a “native” installer and there isn’t an Ubuntu package, we’ll do things the hard way:

  1. Download the latest version of Grinder 3. I’m using version 3.11. This should be a zip file.
  2. Unzip this file in an arbitrary location. For me, this created a folder called grinder-3.11.
  3. $ unzip
  4. Move this Grinder folder under the /opt folder.
  5. $ sudo mv grinder-3.11 /opt
  6. To make our lives a little simpler, make yourself the owner of the /opt/grinder. My username is grinder, so this is how I would do this:
  7. $ sudo chown -R grinder:grinder /opt/grinder-3.11

Now The Grinder is officially “installed”, but it’s a little clunky to use. Let’s fix that.


Adding the grinder.jar file to your CLASSPATH variable will make it much easier to use The Grinder:

  1. Open your $HOME/.bash_profile file using a text editor.
  2. Look for a CLASSPATH variable.
  3. If one exists, then add /opt/grinder-3.11/lib/grinder.jar to it.
  4. If the CLASSPATH variable doesn’t exist in this file, then add the following to lines:
    • CLASSPATH=$CLASSPATH:/opt/grinder-3.11/lib/grinder.jar
    • export CLASSPATH

Now either log out and back in or source your .bash_profile file by typing the following command:

# you should only have to do this the first time
$ source ~/.bash_profile


Once the grinder.jar file is in your classpath, you can start different Grinder components using their full Java path. For example, you should be able to start the Grinder Console using the following command:

$ java net.grinder.Console

This isn’t terribly difficult, but it’s hard to remember and tedious to type. We’re therefore going to create alias shortcuts for the Console and TCPProxy commands. Open your $HOME/.bashrc file in a text editor and add the following lines anywhere in the file:

alias gconsole="java net.grinder.Console"
alias gproxy="java net.grinder.TCPProxy"

Now either log out and back in or source your .bashrc file by typing the following command:

# you should only have to do this the first time
$ source ~/.bashrc

Finally, you can start the Grinder Console and TCPProxy components by simply typing gconsole and gproxy, respectively.


You should now have a working version of The Grinder that is very easy to execute.

You must be logged in to post a comment.

Proudly powered by WordPress   Premium Style Theme by
WordPress Appliance - Powered by TurnKey Linux