Last active
August 29, 2015 14:04
-
-
Save theothermattm/77bd9e9685911612af58 to your computer and use it in GitHub Desktop.
Get Java 7 visualvm working on remote Tomcat server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tomcat setup | |
# add the following to the JVM_OPTS for the given tomcat instance | |
VISUAL_VM_SETTINGS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.port=8086 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Xverify:none" | |
# note that on os x, some StackOverflow posts have discussed the need for an additiona "-Xshare:off" setting. | |
# To run jstatd | |
# create a file called jstatd.all.policy | |
# see http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstatd.html | |
# with the following in it: | |
echo "grant codebase \"file:\${java.home}/../lib/tools.jar\" { \ | |
permission java.security.AllPermission; \ | |
};" > /tmp/jstatd.all.policy | |
# start jstatd from java home | |
${JAVA_HOME}/jstatd -J-Djava.security.policy=/tmp/jstatd.all.policy | |
# you can then connect on port 8086, though visualvm should pick it right up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment