1.如Java文件
2.进入.class的目录最外层org的界面
3.打开命令窗口输入如下指令:jar -cvf hello_agent.jar org
4.运行 java -javaagent:hello_agent.jar=xunche org/xunche/app/HelloWorld
5.解决 Failed to find Premain-Class manifest attribute in hello_agent.jar 问题
Manifest-Version: 1.0
Created-By: 1.8.0_191 (Oracle Corporation)
Main-Class: norepeat.NoRepeatApp
Premain-Class: org.xunche.agent.HelloAgent
Can-Redefine-Classes: true
Can-Retransform-Classes: true
Agent-Class: org.xunche.agent.HelloAgent
6.再次运行