Creating JVM
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

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

Re: Creating JVM

Posted By:   Sita_Yo  
Posted On:   Tuesday, August 7, 2001 06:28 PM

I forgot to mention that I am using jdk1.2 on a linux machine.
About | Sitemap | Contact