I´m trying to install an application health monitoring application that can monitor J2EE web transactions and I need to put a javaagent into my Tomcat somehow but am not cl
To add to mindas' answer, the -javaagent
command could also be added to the JAVA_OPTS
environment variable in one of the following (if they exist):
<tomcat_home>/conf/tomcat6.conf
JAVA_OPTS="${JAVA_OPTS} -javaagent:/full/path/to/YourJar.jar"
or <tomcat_home>/bin/catalina.sh
export JAVA_OPTS="$JAVA_OPTS -javaagent:/full/path/to/YourJar.jar"
Use JAVA_OPTS as CATALINA_OPTS would not allow JVM options [option2]=[value2]
.
Example, for adding jacocoagent.jar with options as below, only JAVA_OPTS will work.
JAVA_OPTS="${JAVA_OPTS} -javaagent:$CATALINA_HOME/lib/jacocoagent.jar=destfile=/tmp/jacoco.exec"
For Unix/Linux, do this in <tomcat_home>/bin/setenv.sh
, e.g.
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/path/to/YourJar.jar"
You might need to create this file if not present and chmod
it to 711
or 755
.
For Windows, the counterpart is setenv.bat
.