• /
  • EnglishEspañolFrançais日本語한국어Português
  • ログイン今すぐ開始

Install the Java agent on app servers and JVM frameworks

|View as Markdown (English)

This page covers the standard installation path for the New Relic Java agent on any supported app server or JVM-based framework. Follow these steps to download the agent, configure it, and verify that data is flowing to New Relic.

Compatibility and requirements

Supported

  • Java 8, 11, 17, 21, 24, 25, and 26 (Java 7 supported on agent v6.5.4 and earlier only)
  • JVM-based languages: Java, Scala, Kotlin, and Clojure
  • App servers and frameworks: Tomcat, Spring Boot, JBoss/WildFly, Glassfish, Jetty, WebLogic, WebSphere, Grails, ColdFusion, Solr, Play, Resin, Tanuki Wrapper, and Geronimo — see compatibility and requirements for supported version ranges
  • Any JVM process that accepts a -javaagent argument

Not supported

  • Running alongside other APM agents — the Java agent cannot guarantee correct behavior when another APM agent is active in the same JVM

You need

  • A New Relic account and
  • A JVM with SHA-2 (256-bit) SSL support
  • Permission to edit your app server's startup scripts or JVM configuration
  • Permission to create a directory to hold the agent files

Install

Download the Java agent

Download newrelic-java.zip using one of these methods:

bash
$
curl -O https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic-java.zip
$
unzip newrelic-java.zip
Invoke-WebRequest -Uri https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic-java.zip -OutFile newrelic-java.zip
Expand-Archive -Path newrelic-java.zip -DestinationPath .

Download newrelic-java.zip from the Java agent release notes page.

After unzipping, the newrelic/ directory contains the agent jar (newrelic.jar) and configuration file (newrelic.yml) that you'll configure in the next steps.

Place the agent files

Create a permanent directory and move the agent files into it:

bash
$
mkdir -p /opt/newrelic
$
mv newrelic/* /opt/newrelic/

We recommend /opt/newrelic on Linux/macOS or C:\opt\newrelic on Windows. Make sure newrelic.jar is not on your application classpath or in any directory listed in java.endorsed.dirs.

Pass the -javaagent argument

Add the -javaagent flag to your app server's JVM startup configuration, pointing to the full path of newrelic.jar. The method differs per server — expand the one that matches your environment:

Configure

Edit newrelic/newrelic.yml and set these two required values:

license_key: 'YOUR_LICENSE_KEY'
app_name: 'My Application'

The agent reads newrelic.yml from the same directory as newrelic.jar at startup. You can also override any setting using Java system properties (e.g. -Dnewrelic.config.license_key=YOUR_KEY) or environment variables.

When using the config file, restrict permissions to read/write for the owner of the application server process only:

bash
$
chmod 600 /opt/newrelic/newrelic.yml

See Java agent configuration for all available options.

Verify your install

Restart your application server. Send at least two requests, then wait 2–3 minutes and your app appears in APM & services.

If no data appears after five minutes, see No data appears (Java).

Copyright © 2026 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.