java: mraa jni library now dynamically links to libmraa
libmraajava.so was statically linking to mraa object files causing duplicate mraa platform instances if a UPM Java module was also loaded. JNI functionality has been moved into src/java/mraajni.c. JVM object is now set when JVM is loaded; see updates to src/java/mraajava.i. This was necessary as the JVM object cannot be directly referenced from mraa as it will not be available when building C/C++ examples. Signed-off-by: Henry Bruce <henry.bruce@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
0633cd4145
commit
9d497e08cd
@@ -65,11 +65,11 @@ class Spi;
|
||||
%include ../mraa.i
|
||||
|
||||
%wrapper %{
|
||||
JavaVM *globVM;
|
||||
#include "java/mraajni.h"
|
||||
|
||||
jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
/* initialize mraa */
|
||||
globVM = vm;
|
||||
mraa_java_set_jvm(vm);
|
||||
mraa_init();
|
||||
return JNI_VERSION_1_6;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user