mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 19:50:38 +08:00
Java API: added JNI_OnLoad to eliminate jvm warnings
This commit is contained in:
parent
1d7877eeaf
commit
1248775177
24
modules/java/src/cpp/jni_part.cpp
Normal file
24
modules/java/src/cpp/jni_part.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include <jni.h>
|
||||
|
||||
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"
|
Loading…
Reference in New Issue
Block a user