Feat: add retransform-class example with build/run scripts and docs

This commit is contained in:
xiaozhou233 committed 2026-08-15 13:41:26 +08:00
1 parent 57405e810c
commit b08656daa6
14 files changed
+340 -4

No files matched your search

@@ -0,0 +1,20 @@
import java.lang.management.ManagementFactory;
public class target {
public static void say() {
System.out.println("Hello!");
}
public static void main(String[] args) {
String pid = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
try {
while (true) {
System.out.println("[Target] I am the target JVM (PID: " + pid + ")");
say();
Thread.sleep(1000);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}