直接上命令

0.下载arthas

1.获取类加载器

输入 sc -d *KillPestProtocol | grep classLoaderHash

输出 classLoaderHash   56cbfb61

2.将源码拖入linux某目录,编译class

mc -c 56cbfb61  /mnt/arthas/source/KillPestProtocol.java -d /mnt/arthas/class

3.加载class

redefine /mnt/arthas/class/com/stkj/iot/netty/protocol/killpets/v00010001/KillPestProtocol.class