r**i 发帖数: 2328 | 1 I used to call C/C++ methods from Java side, now I want to use JNI to call
Java methods from C/C++. The code segment is like below:
#include
#include
#include
#ifdef _WIN32
#define PATH_SEPARATOR ';'
#else
#define PATH_SEPARATOR ':'
#endif
int main()
{
JavaVMOption options[1];
JavaVM *jvm;
JavaVMInitArgs vm_args;
long status;
JNIEnv *env;
jclass cls;
jmethodID mid;
jint square;
jboolean not;
options[0].optionString = "-Djava.class.path=.";
//memset(&vm_args, 0, size | r**i 发帖数: 2328 | 2 I solved this problem by loading jvm.dll at runtime and accessing
JNI_createJavaVM from a function pointer. However, I am still not sure about
this JVM's performance in multi-threads. Does anybody know?
THX!
in
my
【在 r**i 的大作中提到】 : I used to call C/C++ methods from Java side, now I want to use JNI to call : Java methods from C/C++. The code segment is like below: : #include : #include : #include : #ifdef _WIN32 : #define PATH_SEPARATOR ';' : #else : #define PATH_SEPARATOR ':' : #endif
|
|