# Configure the Java agent for Tomcat

Use the guidelines below to configure the Java agent depending on how you run Contrast with Tomcat.

## Run from Windows or Unix

The CATALINA_OPTS environment variable is used to pass configuration flags and system properties to the JVM that runs the Tomcat server.

Tomcat recommends using a setenv script to specify environment variables. You can learn more about the setenv script, including how to find or create it as needed, by consulting RUNNING.txt, which is included with every distribution of Tomcat.

To enable Contrast add the -javaagent configuration to CATALINA_OPTS in either setenv.sh, if running on a Unix-like operating system, or setenv.bat if running on Windows. For example:

• Windows:

set CATALINA_OPTS "-javagent:<YourContrastJarPath>"
• Unix: