ObjectSnoop
 
Inspecting objects in Java  
 

Chapter 2. Installing ObjectSnoop

This chapter will take you through the installation of ObjectSnoop onto your system.

Before you can install ObjectSnoop you must first download it from SourceForge. Included within the distribution is a jar file containing all of the class files required, and this manual is also included for easy reference.

Unfortunately there might be some Windows specific bias in the way that installation is described, so please adjust appropriately for your operating system.

You can download ObjectSnoop from here.

2.1. Installing for general use

Installation involves placing the ObjectSnoop jar into a directory where the Java Runtime Environment (JRE) can find it. As you're using ObjectSnoop as a development tool, I'll assume that your system is set up with the Java SDK.

The SDK includes its own JRE, and this is where you should install ObjectSnoop. The JRE includes a directory specifically set up for adding extensions to the runtime environment.

  • Locate your Java SDK directory. This information may also be stored in a system variable JAVA_HOME.
  • Navigate to the jre/ directory, then lib/, and finally to the ext/ directory.
  • Place the ObjectSnoop jar into this directory and overwriting/removing any previous releases of ObjectSnoop, if there are any. You may need to stop Java processes that are currently running in order to do this.
  • ObjectSnoop should now be available to the next Java process that you start up.

Read Chapter 3 to find out how to use ObjectSnoop in your own programs.

2.2.  Installing the JSP tag libraries

Using ObjectSnoop with a Servlet/JSP container creates several more options on where ObjectSnoop can be installed. If you want to use the tag library then you are probably restricted to directories that are specially treated by the servlet container.

Read Chapter 4 to find out how to use ObjectSnoop with Servlets and Java Server Pages.

2.2.1. For an individual context

  1. Locate the WEB-INF/ directory associated with the context that you want to snoop.
  2. Create a directory called lib/ under WEB-INF/, if it doesn't already exist.
  3. Place the ObjectSnoop jar into this lib/ directory.
  4. You may need to restart the context or servlet container for ObjectSnoop to be recognized. Refer to your container documentation for more details.

The JSP 1.2 specification does not require that an entry is made in web.xml for the tag library to be used. ObjectSnoop uses the URI /objectsnoop, and this should be unique within the context.

2.2.2. For the entire servlet container

If a description isn't included here, consult your container documentation on the appropriate location for the ObjectSnoop jar file.

2.2.2.1.  Tomcat 4.0.4

Place the ObjectSnoop jar into lib/ under the directory location described by the system variable CATALINA_HOME.