The JVM Tool Interface(JVMTI) specification says that the JVMTI agents can be started in the VM during live phase but they ha开发者_如何学Cvent mentioned how it can be done. Has anyone tried this before or got any hints on how to do it?
You can use method
* @param agent
* Path to the JAR file containing the agent.
*
* @param options
* The options to provide to the agent's <code>agentmain</code>
* method (can be <code>null</code>).
com.sun.tools.attach.VirtualMachine.loadAgent(String agent, String options)
from ${java.home}/../lib/tools.jar
精彩评论