Error bootstrapping New Relic Java agent


You start up a Java process running with the New Relic Java agent, but data fails to report to the APM UI. You see an Error bootstrapping New Relic agent message in the stack trace in your application logs.

The message Error bootstrapping New Relic agent can indicate multiple failure modes. The stack trace is also key in diagnosing this issue.

Example stack trace when bootstrapping the Java agent
Error bootstrapping New Relic agent: java.lang.RuntimeException: No such file or directory

java.lang.RuntimeException: No such file or directory

at com.newrelic.bootstrap.BootstrapLoader.load(

at com.newrelic.bootstrap.BootstrapAgent.startAgent(

at com.newrelic.bootstrap.BootstrapAgent.premain(

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(

at sun.reflect.DelegatingMethodAccessorImpl.invoke(

at java.lang.reflect.Method.invoke(

at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(

at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(

Caused by: No such file or directory

at Method)



at com.newrelic.bootstrap.EmbeddedJarFilesImpl$1.load(

at com.newrelic.bootstrap.EmbeddedJarFilesImpl$1.load(








at com.newrelic.bootstrap.EmbeddedJarFilesImpl.getJarFileInAgent(

at com.newrelic.bootstrap.BootstrapLoader.addBridgeJarToClassPath(

at com.newrelic.bootstrap.BootstrapLoader.load(

... 8 more


If the Java agent cannot create the temporary jar files, it will fail to start up and will return the Error bootstrapping New Relic agent line preceding the stack trace to System.err. If you are using an app server, this usually appears in your app server's error logs.

Here are common reasons for this failure and the solution.

Temp directory is different from system property

This failure can occur when you specify a temporary directory location for the Java process that is not the default location specified by To solve this problem, pass in the system property -Dnewrelic.tempdir=/path/to/tmpdir to the JVM at startup.

New Relic's Java agent will try to use the default temporary directory location for Java ( unless this system property is passed in. If you specified a different temporary directory location for the JVM to use, then the default directory location may not exist, or the Java agent may not have write access to it.

Temp directory does not exist at JVM startup

This failure can occur if the temp directory does not exist when the JVM is starting up. The Java agent starts up very early in the JVM's lifecycle. The agent will not attempt to create the temporary directory if it does not already exist.

For example, part of your process lifecycle might be to delete the java temp directory as your process is finishing. In this situation, make sure the java temp directory will be created again before the Java agent next starts up.

User cannot write to existing temp directory

This failure can occur if the temp directory exists but it cannot be written to by the user starting the java process. This prevents the Java agent from starting up successfully.

To solve this problem, verify permissions for the user starting the Java process that is running the Java agent. Make sure the user has write and execute permissions for the temp directory location.

Other troubleshooting tips

If none of these troubleshooting tips work, see the information about providing Java information for troubleshooting.

For more help

If you need more help, check out these support and learning resources: