问题
I want to add a java agent to process ID of the already running java application. Is there any way doing that using command line, something like
java -jar java agent.jar process_id
or if i can edit the hotspot JVM start up script directly to add the java agent there itself, but how can i edit the hotspot JVM start up script. I am using UNIX.
回答1:
If you are working with the sun JVM you can use the dynamic attach agent.
http://docs.oracle.com/javase/7/docs/technotes/guides/attach/index.html
来源:https://stackoverflow.com/questions/25479268/adding-javaagent-to-process-id-or-jvm-start-up