Java agent self-installer

The New Relic Java agent's self-installer is fully compatible with many Tomcat, JBoss, and Glassfish. Other frameworks may require manual editing of the start scripts.

As part of the installation process, change the default application name to a meaningful name. Also, change the default newrelic.yml file permissions to be read/write only for the owner of the app server process.

Use the Java self-installer

To use the Java agent, you need a New Relic account.

  1. Log in to New Relic.
  2. Select Get Started. If you have existing applications, select [plus-circle] Add more.
  3. From Choose your language, select Java.
  4. Follow the online installation steps, and download the installer.

Unless you have special considerations, you should be able to complete your New Relic install by following the online instructions. This document provides additional information on the install process.

[video link] For Java agent installation tips, watch this New Relic video (approximately 1 minute).

Optional file download procedure

The Account settings page lists the most recent agents by platform in the right-hand column.

  1. From the New Relic UI's account dropdown, select Account settings.

  2. Download the agent for your platform.

  3. Unpack into your app server's root directory. For Glassfish, unpack into your domain's directory.

    unzip -d /path/to/appserver/
  4. Copy a "clean" newrelic.yml config file (containing only the default settings provided by New Relic) into the newrelic directory.

screen manual java download.png
Account settings is on the menu bar in the menu under your account name.

Run the installer

The installer is bundled inside the agent jar. Execute it from the newrelic directory with the install command.

cd /path/to/appserver/newrelic
java -jar newrelic.jar install

The installer will find your start script, back it up, and edit it to add the agent switch.

Options for the installer include:

Option Description
-h Display help information.
-l LICENSEKEY Your account license key.
-s /path/to/applicationserver Location of your application server. Required if newrelic is not in your app server home directory.

The installer provides feedback on whether the install succeeded.

  • If it runs successfully, it will tell you to restart your app server, exercise your app, and log in to see your data.
  • If it did not complete, it will explain why, and point you to Java agent manual install.

JSVC on Windows

On Windows, the installer will add itself to catalina.bat, but not to the jsvc startup command.

For more help

Additional documentation resources include:

Recommendations for learning more: