This example primarily shows how to manually use the instrumentation library by modifying the source code. In practice, we always use the binary instrumentation module to automatically configure the trace points without having access to the source code.
- Select File | Project Structure to open the Project Structure dialog.
- Under Project Settings, select Modules.
- Select Dependencies tab.
- On the right hand side, click the + and select Jar or Directories... option.
- Select the appropriate instrumentation library JAR and click okay.
This step is equivalent of putting the the JAR on the example's classpath.
- Compile the example using javac
- Run SimpleExample1 and include the lib/InstrumentationTools.jar in the classpath.