From 1248775177b7e8eb3826c93778a16513c17b7840 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Tue, 9 Aug 2011 14:58:24 +0000 Subject: [PATCH] Java API: added JNI_OnLoad to eliminate jvm warnings --- modules/java/src/cpp/jni_part.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 modules/java/src/cpp/jni_part.cpp diff --git a/modules/java/src/cpp/jni_part.cpp b/modules/java/src/cpp/jni_part.cpp new file mode 100644 index 0000000000..8273d94314 --- /dev/null +++ b/modules/java/src/cpp/jni_part.cpp @@ -0,0 +1,24 @@ +#include + +extern "C" { + +JNIEXPORT jint JNICALL +JNI_OnLoad(JavaVM* vm, void* reserved) +{ + JNIEnv* env; + if (vm->GetEnv((void**) &env, JNI_VERSION_1_6) != JNI_OK) + return -1; + + /* get class with (*env)->FindClass */ + /* register methods with (*env)->RegisterNatives */ + + return JNI_VERSION_1_6; +} + +JNIEXPORT void JNICALL +JNI_OnUnload(JavaVM *vm, void *reserved) +{ + //do nothing +} + +} // extern "C" \ No newline at end of file