Skip to content
Advertisement

Tag: java-native-interface

Understanding safe access of JNI arguments

I’m doing some research regarding how HotSpot performs garbage-collection and/or heap-compaction while JNI code is running. It appears to be common knowledge that objects could be moved at any time in Java. I’m trying to understand, definitively if JNI is subject to effects garbage-collection. There exist a number of JNI functions to explicitly prevent garbage-collection; such as GetPrimitiveArrayCritical. It makes

Failed to locate method JNI_GetCreatedJavaVMs in the libjvm.dylib (Mac OS)

I am trying to embed java virtual machine in my program but I libjvm.dylib lacks JNI_GetCreatedJavaVMs. The program works fine both on Windows and on Linux platforms. However, when running on Mac OS I’m getting: exception. I use libjvm.dylib located in /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Libraries directory. I think the issue is in using the wrong libjvm however, I was unable to find it

Advertisement