Jvm Attach make it easy to execute operations into remote running Java Virtual Machines from Java code, zero C/C++ needed.
- Attach shared library agent
- Attach jar JavaAgent
- All other features supported by jattach
compile("com.mageddo.jvmattach:jvm-attach:1.0.0");
public class Main {
public static void main(String[] args) {
JvmAttach.loadJar(JvmAttach.getCurrentPid(), Main.class.getResourceAsStream("/simple-agent.jar"));
// simple agent loaded: null
}
}
See unit tests for more examples
- HotSpot JRE 8+, OpenJ9 JVMs are not supported, no JDK needed