Displaying 1 result from an estimated 1 matches for "attachcurrentthread".
2009 Apr 05
1
RJava question(class not found with rJava's vm, though found with alternate vm)
...ized = JNI_TRUE;
JavaVM *jvms[32];
jsize vms=0;
int r=0;
r=JNI_GetCreatedJavaVMs(jvms, 32, &vms);
if (r) {
error("JNI_GetCreatedJavaVMs returned %d\n", r);
} else {
if (vms>0) {
int i=0;
while (i<vms) {
if (jvms[i]) {
if (!(*jvms[i])->AttachCurrentThread(jvms[i], (void**)&jenv, NULL)) {
jvm=jvms[i];
break;
}
}
i++;
}
if (i==vms) error("Failed to attach to any existing JVM.");
}else {
JNI_CreateJavaVM(&jvm, (void **)&jenv, &args);
}
}
}
Saptarshi Guha
[[a...