Sun Microsystems, Inc  JMX Reference Implementation
Tutorial

  [ Contents ]
Contents
[ Next ]
The Agent View

Launching the Base Agent

Like the JMXTM reference implementation (RI), this tutorial is targeted at the Java 2 platform. Be sure the Java 2 SDK can be found in your path when building or launching Java classes. Whenever compiling or running Java classes in this tutorial, the jar files of the JMX RI (lib/jmxri.jar) and JMX toolkit (lib/jmxtools.jar) must also be found in the classpath.

This tutorial relies on the following classes; their source files can all be found among the examples provided in this software bundle. In order to proceed through the tutorial, all of these classes must be found in the classpath when launching the base agent.

The easiest way to ensure this is to create an empty directory to which you can copy and compile these source files from the examples. If you have already compiled the examples, you can just copy their class files:

Action:  To set up a directory for the tutorial, type these commands from the main directory of the software bundle:

prompt% mkdir tutorial; cd tutorial

prompt% cp ../examples/BaseAgent/BaseAgent.java .
prompt% cp ../examples/MonitorMBean/Simple.java .
prompt% cp ../examples/MonitorMBean/SimpleMBean.java .
prompt% cp ../examples/DynamicMBean/SimpleDynamic.java .

prompt% javac -classpath ../lib/jmxri.jar:../lib/jmxtools.jar \
*.java

Action:  Now launch the BaseAgent class in this new directory with all the example classes:

prompt% java -classpath .:../lib/jmxri.jar:../lib/jmxtools.jar \
BaseAgent

Action:  The JMX agent is now running on your machine. To manage the agent through a Web browser, load the following URL:

[Internet Explorer users might have to click here: http://localhost:8082/]

You can also access this agent from any remote machine on the same network by connecting to this URL: http://agentHostName:8082/ (where agentHostName is the name or IP address of the machine where you launched the BaseAgent).


  [ Contents ]
Contents
[ Next ]
The Agent View

Java coffee cup logo

Copyright 2000-2003 Sun Microsystems, Inc.,  
All rights reserved.