0

I am trying to install newrelic agent on my linux server and following https://docs.newrelic.com/docs/agents/java-agent/installation/install-java-agent and stuck in step 3 of install the java agent - includeJava agent with a JVM argument.

I am new to this not sure how to pass the -javaagent argument on Tomcat, pls see below and could you pls let me know where to place below line in catalina.sh file.

Configure your catalina.sh file to use the New Relic agent using the JAVA_OPTS environment variable:
export JAVA_OPTS="$JAVA_OPTS -javaagent:/full/path/to/newrelic.jar"

Thanks!

1 Answers1

0

The catalina.sh file itself warns you:

# Environment Variable Prerequisites
#
#   Do not set the variables in this script. Instead put them into a script
#   setenv.sh in CATALINA_BASE/bin to keep your customizations separate.

You should consider the New Relic instructions are slightly wrong and place the line in setenv.sh instead. Create the file if it does not exist.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • Just created a file named "setevn.sh" with `JAVA_OPTS="-javaagent:/usr/newrelic-temp/newrelic/newrelic.jar"`i.e., path for my newrelic.jar file – user581926 Jul 07 '20 at 09:58