Configure the Java agent for IntelliJ

To add the Contrast agent to an application using IntelliJ IDE's supported application servers:

  1. Click on Run in the application toolbar, and then click on the Edit Configuration menu item from the drop-down menu.

  2. Select the IntelliJ Server configuration instance.

  3. Select the Server tab, and enter the Contrast launcher string in VM Options: -javaagent:<YourContrastJarPath>. Substitute <YourContrastJarPath> with the path to your Contrast JAR.

  4. Click Apply and then OK.

  5. Start the Server.

  6. A Contrast startup message should appear in the Server console. (Allow one to two extra minutes for server startup.)

  7. Navigate to your application and allow an extra minute for it to start up.

Run Contrast on GlassFish with IntelliJ

To run Contrast on GlassFish with IntelliJ:

  1. In the menu bar, select the Start/Run icon next to the GlassFish service.

  2. Wait for the server to finish launching.

  3. Navigate to the GlassFish Server Administration Console (usually http://localhost:4848/).

  4. After the console has finished loading, select Configurations > server-config.

  5. Select JVM Settings.

  6. Select Profiler.

  7. Add the name "Contrast".

  8. Replace <YourContrastJarPath> with the path to your Contrast JAR file and add the following JVM options:

    -javaagent:<YourContrastJarPath>
  9. Select Save.

  10. Select the Start/Run icon next to the GlassFish service from the top menu bar and select Restart Server.

  11. A Contrast startup message should appear in the GlassFish server log console. (Allow one to two extra minutes for server startup.)

  12. After GlassFish has finished the startup process, IntelliJ will open a new web browser.

  13. Navigate to your application, and allow an extra minute for it to start up.