AnExampleJavaAgent

Smoke Test
code format="text" java -javaagent:Registrar.jar -Dschuchert.ClassFileTransformer=schuchert.agent.NullClassFileTransformer schuchert.agent.Main code code format="text" Congratulations, everything seems to be working code
 * Download this jar file [[file:Registrar.jar]]
 * Start a command prompt and change to the directory where you downloaded Registrar.jar
 * At a command prompt, type the following command (making sure you are using a Java 5 VM or later)
 * Verify that you see only the following output:

If you see anything else, check here

Contents of Jar
The Registrar.jar file contains several things, including source and class files and even a JUnit 4 test. IF you want to actually run that test, you'll need to have the following in your class path: Or better yet, you can just download this Eclipse 3.3 workspace and run the tests within eclipse: >> This creates a directory called JavaAgent under the target directory
 * JUnit 4.4 (not shipped with Eclipse 3.3 or before)
 * JMOck 2.4
 * 1) Download this file
 * 2) Extract the file to some directory, e.g. PC: **c:\workspaces** or Mac: **/Users/schuchert/workspaces**
 * 1) Start Eclipse
 * 2) Select the JavaAgent directory when Eclipse asks for a workspace, e.g. PC: **c:\workspaces\JavaAgent** or Mac: **/Users/schuchert/workspaces/JavaAgent**
 * 3) You might get a few errors regarding not being able to open some perspectives, (e.g. if you do not have the subclipse perspective installed). You can safely ignore these errors.
 * 4) Select the project JavaAgentRegistrar
 * 5) Right-click:Run As:Junit Test

If you want to verify that you can also run a Java Application, do the following:
 * 1) Expand the **JavaAgentRegistrar** project
 * 2) Open the package **schuchert.agent**
 * 3) Select **Main.java**
 * 4) Right-click:Run As:Java Application
 * 5) You will probably get an error in the console because you need to set execution properties for Main:
 * 6) Right-click on **Main.java**
 * 7) Select:Run As:Open Run Dialog...
 * 8) Click on the **(x) = Arguments tab**
 * 9) **Under VM arguments:** enter the following: -javaagent:Registrar.jar -Dschuchert.ClassFileTransformer=schuchert.agent.NullClassFileTransformer
 * 10) Click **Run**

This will create a new jar and replace the one that is currently in that project.
 * Recreate Registrar.jar**
 * 1) Open the **JavaAgentRegistrar** project
 * 2) Select **RecreateJar.jardesc**
 * 3) Right-click and select **Create JAR*