Posted By:
Sita_Yo
Posted On:
Tuesday, August 7, 2001 12:27 AM
I am trying to write a simple c program that will create a JVM. I manage to compile it but as I run the executable it always result in core dumped Does anyone know the causes of such failure? Thanks #include int main( int argc, char *argv[] ) { JNIEnv *env; JavaVM *jvm; JDK1_1InitArgs vm_args; jint res; vm_args.version = 0x00010002; JNI_GetDefaultJavaVMInitArgs(&vm_args); res=JNI_CreateJavaVM(&jvm,(void **)&env,&vm_args); if (res < 0) { printf("%s","Can't create Java VM "); exit(1); } else { printf ("%s","
More>>
I am trying to write a simple c program that will create a JVM. I manage to compile it but as I
run the executable it always result in core dumped
Does anyone know the causes of such failure? Thanks
#include
int main( int argc, char *argv[] )
{
JNIEnv *env;
JavaVM *jvm;
JDK1_1InitArgs vm_args;
jint res;
vm_args.version = 0x00010002;
JNI_GetDefaultJavaVMInitArgs(&vm_args);
res=JNI_CreateJavaVM(&jvm,(void **)&env,&vm_args);
if (res
< 0)
{
printf("%s","Can't create Java VM
");
exit(1);
}
else
{
printf ("%s","JVM created");
}
(*jvm)->DestroyJavaVM(jvm);
return(0);
}
<<Less