MohamedSanaulla
MohamedSanaulla

Reputation: 6242

Starting JVM Tool Interface agents in the VM during live phase

The JVM Tool Interface(JVMTI) specification says that the JVMTI agents can be started in the VM during live phase but they havent mentioned how it can be done. Has anyone tried this before or got any hints on how to do it?

Upvotes: 2

Views: 1002

Answers (1)

Sergii Kabashniuk
Sergii Kabashniuk

Reputation: 119

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

Upvotes: 2

Related Questions