I want to be able to inject a .dll into a running JVM process. What I’m wondering is, once I’ve done this, can I somehow get the JNIEnv instance which would allow me to access objects within the running JVM? What I’m trying to achieve is something along the lines of Java Reflection, but on a native level.
Share
Attach API is what you want to inject a DLL from outside the process. Note that it requires suitable OS permissions. Then use JNI Invocation API and standard JNI APIs to do whatever you need from inside.
Attach API from Oracle
and
Attach API from IBM