B
Bert Boehne
hi!
i'm busy with jni. i want to start a jvm from my c++ code and call a
java method. that's working so far. but i have the problem that it has
to be possible to destroy the jvm and create afterwards again. i can't
just create the jvm in the main program and let it run until the main
program ends. that's because i'm writing a plug in to an existing program...
i downloaded the source from sun where i found the file jni.cpp. there
are the functions JNI_CreateJavaVM, jni_DestroyJavaVM and so on. also
there is a global variable:
volatile jint num_vm_created = 0; // number of VMs created so far
this variable will be checked at a call of JNI_CreateJavaVM. would it be
possible to set this variable to zero after calling jni_DestroyVM
(jni_DestroyJavaVM doesn't do that)i could create a jvm again.
now, here is my question: does someone know how to reach that variable
to set it to 0 again? or does someone have another idea to do the job?
greats,
bert
i'm busy with jni. i want to start a jvm from my c++ code and call a
java method. that's working so far. but i have the problem that it has
to be possible to destroy the jvm and create afterwards again. i can't
just create the jvm in the main program and let it run until the main
program ends. that's because i'm writing a plug in to an existing program...
i downloaded the source from sun where i found the file jni.cpp. there
are the functions JNI_CreateJavaVM, jni_DestroyJavaVM and so on. also
there is a global variable:
volatile jint num_vm_created = 0; // number of VMs created so far
this variable will be checked at a call of JNI_CreateJavaVM. would it be
possible to set this variable to zero after calling jni_DestroyVM
(jni_DestroyJavaVM doesn't do that)i could create a jvm again.
now, here is my question: does someone know how to reach that variable
to set it to 0 again? or does someone have another idea to do the job?
greats,
bert