Java - requesting JNI_VERSION_1_6 rather than JNI_VERSION_1_8 to support Android.

This commit is contained in:
Adam Pocock 2020-01-29 11:46:00 -05:00 committed by Changming Sun
parent f60badc1f3
commit 8a1de1a582

View file

@ -10,7 +10,9 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) {
// To silence unused-parameter error.
// This function must exist according to the JNI spec, but the arguments aren't necessary for the library to request a specific version.
(void)vm; (void) reserved;
return JNI_VERSION_1_8;
// Requesting 1.6 to support Android. Will need to be bumped to a later version to call interface default methods
// from native code, or to access other new Java features.
return JNI_VERSION_1_6;
}
/**