Tutorial by Examples

#include <vector> #include <string> #include "agent_util.hpp" //this file can be found in Java SE Development Kit 8u101 Demos and Samples //see http://download.oracle.com/otn-pub/java/jdk/8u101-b13-demos/jdk-8u101-windows-x64-demos.zip //jdk1.8.0_101.zip!\demo\jvmti\v...
Inside Agent_OnLoad method: jvmtiEnv* jvmti; /* Get JVMTI environment */ vm->GetEnv(reinterpret_cast<void **>(&jvmti), JVMTI_VERSION);
/* Callback for JVMTI_EVENT_VM_INIT */ static void JNICALL vm_init(jvmtiEnv* jvmti, JNIEnv* env, jthread thread) { jint runtime_version; jvmti->GetVersionNumber(&runtime_version); stdout_message("JVMTI Version: %d\n", runtime_verision); } /* Agent_OnLoad() is ca...

Page 1 of 1