nbfcome 2007-08-15
int _tmain(int argc, _TCHAR* argv[])
{
intres;
JavaVM*jvm;
JNIEnv*env;
JavaVMInitArgs vm_args;/*设置初始化参数*/
JavaVMOptionoptions[3];
options[0].optionString="-Djava.compiler=NONE";
options[1].optionString="-Djava.class.path=.;";
options[2].optionString = "-verbose:jni";vm_args.version = JNI_VERSION_1_4;//版本号设置不能漏
vm_args.nOptions=3;
vm_args.options=options;
vm_args.ignoreUnrecognized=JNI_TRUE;
res=JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
if(res<0){
fprintf(stderr,"Can'tcreateJavaVM\n");
exit(1);
}
fprintf(stdout,"JavaVMdestory.\n");
return0;
}这个例子也是摘自网上的 ,只不过是调试通过了.
但是为什么一直提示找不到 jvm.dll 呢