JDK1_1InitArgs
当我使用JDK1_1InitArgs vm_args
编译器初始化时给我错误。我需要初始化这个变量才能使用该函数JNI_CreateJavaVM
。
JavaVM *jvm;
JNIEnv *env;
jmethodID mid;
JDK1_1InitArgs vm_args; // Line 47
vm_args.version = 0x00010001; // Line 48
JNI_GetDefaultJavaVMInitArgs(&vm_args);
vm_args.classpath = "C:/Program Files/Java/jdk1.7.0/lib;.;";
JNI_CreateJavaVM(&jvm, &env, &vm_args);
env = (*jvm)->AttachCurrentThread(jvm,&env,NULL);
jclass cls = (*env)->GetObjectClass(env,Obj);
mid = (*env)->GetMethodID(env,cls,"callBack","(Ljava/lang/String;)V");
(*env)->CallVoidMethodA(env,Obj,mid,(*env)->NewStringUTF(env,"1B"));
错误:
为什么我会收到这些错误?我怎样才能摆脱它们?