Our Java agent auto-instruments your code so you can start monitoring applications. You can use our launcher, or follow the instructions in this document to complete a basic Java agent installation.
Check the following:
- Make sure you've signed up for a New Relic account. It's free, forever.
- Review the compatibility and requirements.
- Check if your environment requires additional or alternative install steps.
Invoke-WebRequest (PowerShell), or the New Relic UI:
Here's how to do a basic setup with agent configuration settings in
For an advanced installation, you can pass settings with environment variables, Java system properties, or server-side configuration. To understand the precedence of these configuration settings, see Java agent configuration: Config file.
The Java agent requires the
app_name settings at startup. All the other settings are optional, and you can review them in Java agent configuration: Config file.
Go to the unzipped installation file, and inside the
newrelic subdirectory, edit
Find the line with
Replace '<%= license_key %>' with your license. For example:license_key: 456n20n1367ov2s174v51nvn789d21s67v26NRAL
Find the line with
Replace My Application with a name that helps you identify the application. For example:app_name: Tax Calculator
If you need tips about how to name your application, see Name your application.
Save and close
The Java agent installation involves copying all the unzipped New Relic files into the directory structure of your application server/container. For example, you can create a
/opt/newrelic directory, but if you want to put the files elsewhere, make sure of the following:
- The .jar files in the directory cannot be on the classpath.
- The .jar files cannot be in directories specified in
To install the Java agent:
In your application server/container directory structure, create a directory for New Relic files (for example,
Copy all the New Relic files from your unzipped
newrelicdirectory into your new directory.
Make sure that your application server/container includes this option when it starts Java (for tips on how to do this with your tool or framework, see JVM arguments):
Start or restart your application server/container.
If you are using
newrelic.yml to make configuration settings, consider the following:
- We recommend you change the default
newrelic.ymlfile permissions to read/write only for the owner of the application server process.
- As you would with other important files, be sure
newrelic.ymlis part of your backup routine.
- We recommend using New Relic Diagnostics to validate your settings, either before or after you deploy.
Here are some additional topics to consider:
- For Docker questions, see Install New Relic Java agent for Docker.
- View your app in New Relic and get comfortable with the user interface.
- Read the documentation about APM. For example, read about the Summary page, the JVM metrics page, the Transactions page, and other performance monitoring features.
- Query your data using NRQL (New Relic Query Language).
- Learn about setting up custom instrumentation and async instrumentation for application activity not monitored by default.
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's data security and licenses documentation.