Tomcat installation for Java

These directions for Tomcat (Windows) supplement New Relic's Java agent installation directions:

For other Tomcat platforms such as Linux, follow New Relic's manual installation procedures for Tomcat.

Tomcat for Windows

Most Windows users run Tomcat as a service. Tomcat provides a configuration application to specify JVM arguments for the service wrapper:

  1. Select Start > Apache Tomcat (version) > Configure Tomcat.
  2. Select Java.
  3. In the Java Options text box, specify the path to newrelic.jar. Use forward slashes / for the path separator:

    -javaagent:/full/path/to/newrelic.jar

    For Tomcat 6, add a line break after the -javaagent switch.

  4. Select Apply.
  5. Restart Tomcat.

Wait a few minutes, then check your app's performance! If you don't see any data after waiting a few minutes, see No data appears.

If you use catalina.bat to launch Tomcat, add this line near the top of the file:

SET JAVA_OPTS=%JAVA_OPTS% -javaagent:/full/path/to/newrelic.jar
Screen Tomcat config pane.jpg
Add the -javaagent switch to the Java Options in the Tomcat configuration pane.

The Apache Commons daemon (jsvc)

The version of Apache Commons Daemon (jsvc) included with Tomcat 6 does not support the -javaagent switch used by New Relic. See the Apache bug tracking the issue.

There is a fix in the Apache Commons source repository. For more information:

You may also be able to use a binary build of jsvc.

A build of the jsvc daemon from the trunk source will support the -javaagent switch via the -X prefix.

For more help

Additional documentation resources include:

Join the discussion about Java monitoring in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at support.newrelic.com.