jvm-attach
jvm-attach copied to clipboard
Load Java Agents at any running JVM process and more, no JDK needed
Jvm Attach
Jvm Attach make it easy to execute operations into remote running Java Virtual Machines from Java code, zero C/C++ needed.
Features
- Attach shared library agent
- Attach jar JavaAgent
- All other features supported by jattach
Usage
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
Requirements
- HotSpot JRE 8+, OpenJ9 JVMs are not supported, no JDK needed