public static void main(String[] args) throws Exception {
    if (args.length != 4 || !args[0].equals("attach-agent")) {
      System.err.println("Usage: ./app attach-agent PID AGENT_JAR AGENT_ARGUMENTS");
      System.exit(1);
    }

    String pid = args[1];
    String agentJar = args[2];
    String agentArguments = args[3];

    System.out.println("ADD-TO-CLASSPATH-MAIN: PID:" + pid + " AgentJar:" + agentJar + " Args:" + agentArguments);

    VirtualMachine virtualMachine = VirtualMachine.attach(pid);
    virtualMachine.loadAgent(agentJar, agentArguments);
    virtualMachine.detach();
  }
public static void main(String[] args)