用jni 初始化jvm
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 呢
相关推荐
ChenRuiyz 2020-07-26
zhouxihua0 2020-06-13
郭朝 2020-06-11
jvm 2020-06-10
nbfcome 2020-06-07
lxttiger 2020-08-18
一支菜鸟 2020-07-27
pbaabc 2020-07-23
liufangbaishi0 2020-07-18
一支菜鸟 2020-07-06
jvm 2020-07-04
dushine00 2020-06-21
bulargyzone 2020-10-26
csdnxingyuntian 2020-10-19
Locksk 2020-10-12
liufangbaishi0 2020-09-23
darlingtangli 2020-09-10
coolrainman 2020-07-28
zhouxihua0 2020-07-27