Java Dynamic Management Kit 4.1 Tutorial

Directories and Classpath

These tutorials are based on the example programs shipped with the Java Dynamic Management Kit. Each example is a set of Java source code files in a separate subdirectory. The following table gives the location of the main examples directory:

Operating Environment 

Examples Directory 

Solaris 

installDir/SUNWjdmk/jdmk4.1/JDKversion/examples

Windows NT 

installDir\SUNWjdmk\jdmk4.1\JDKversion\examples

Except where noted, the source code in this book is taken from these example programs. However, code fragments may be rearranged or comments may be changed. Program listings in the tutorials usually simplify comments and remove output statements for space considerations.

On the Solaris platform, you must have root access in order to write in the installed examples directory. For this reason, it may be necessary to copy all examples to a different location before compiling them. Throughout the rest of this book, we will use the term examplesDir to refer to the main examples directory in a location where you can compile and run them.

When either compiling or running the example programs, the jar file for the Java Dynamic Management Kit runtime must be in your classpath:

JDK Version 

Classpath for Compiling or Running the Examples on Solaris 

1.1 

.:installDir/SUNWjdmk/jdmk4.1/1.1/lib/jdmkrt.jar:installDir/SUNWjdmk/jdmk4.1/1.1/lib/collections.jar

1.2 

.:installDir/SUNWjdmk/jdmk4.1/1.2/lib/jdmkrt.jar

These classpaths are identical on the Windows NT platform, with the forward slashes (/) replaced with back-slashes (\), and the colons (:) replaced with semi-colons (;).

This classpath assumes that you are in the subdirectory of a particular example when compiling or running it. You specify the classpath on the command line of the javac and java tools with the -classpath option. The JDK version must match the version of the javac or java command that you are using.

Throughout the rest of this book, we will use the term classpath in command line examples to indicate that you must use the classpath indicated above. You may also define this classpath in an environment variable according to your platform and omit its definition on the command line.

In order to use the proxygen and mibgen tools provided with the Java Dynamic Management Kit, you should add the installation's binaries directory your environment's path. The following table give the location of this directory:

Operating Environment 

Binaries Directory 

Solaris 

installDir/SUNWjdmk/jdmk4.1/JDKversion/bin

Windows NT 

installDir\SUNWjdmk\jdmk4.1\JDKversion\bin