Upgrade the Java agent

To ensure that you have the most up-to-date version of New Relic, refer to the Java agent release notes. If your agent is outdated, follow this procedure. These steps describe replacing some of the current contents of your agent root directory containing the New Relic Java agent (newrelic.jar) with newly downloaded contents from the New Relic UI.

Upgrade procedures

To identify which version of the Java agent you're currently using, run java -jar newrelic.jar -v. Your Java agent version will be printed to your console.

  1. Back up the entire Java agent root directory to another location. Rename that directory to NewRelic_Agent#.#.#, where #.#.# is the agent version number.
  2. Go to rpm.newrelic.com/apm > (select your account name) > Account settings.
  3. Download the agent for your platform.
  4. Unzip the new agent download file, then copy newrelic-api.jar and newrelic.jar into the original Java agent root directory.
  5. Diff your current newrelic.yml with the newly downloaded newrelic.yml from the zip, and update customized differences as needed.
  6. Restart your Java dispatcher.

If you experience issues after the Java agent upgrade, restore from the backed-up New Relic agent directory.

Update differences in agent versions

If differences between the two versions are unrelated to your app's customizations, align the newrelic.yml you use moving forward with the latest updates to the default newrelic.yml from New Relic.

For example, if you diff the default newrelic.yml files for Java agent versions 3.29.0 and 3.30.0, the results printed to the console will be:

➜ diff newrelic_3.29.0.yml newrelic_3.30.0.yml
254a255,265
> # Classes loaded by classloaders in this list will not be instrumented.
> # This is a useful optimization for runtimes which use classloaders to
> # load dynamic classes which the agent would not instrument.
> classloader_excludes:
> groovy.lang.GroovyClassLoader$InnerLoader,
> org.codehaus.groovy.runtime.callsite.CallSiteClassLoader,
> com.collaxa.cube.engine.deployment.BPELClassLoader,
> org.springframework.data.convert.ClassGeneratingEntityInstantiator$ObjectInstantiatorClassGenerator,
> org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer$ContextClassLoader,
> gw.internal.gosu.compiler.SingleServingGosuClassLoader,
> 

These lines were added to the default newrelic.yml in Java agent version 3.30.0. If you want to run Java agent version 3.30.0 or higher, ensure you include these lines in your newrelic.yml.

For more help

Additional documentation resources include:

Recommendations for learning more: