I am using Visual Studio 2015 and I am using JNI API to use jar library in C++ code.
#include<jni.h>
...
int main() {
JavaVM *jvm;
JNIEnv *env;
JavaVMInitArgs vm_args;
JavaVMOption *options = new JavaVMOption[1];
jint result = 0;
options[0].optionString = "-Djava.class.path=E:/libraries/MorphemeAnalyzer/org.snu.ids.ha.jar;";
vm_args.version = JNI_VERSION_1_6;
vm_args.nOptions = 1;
vm_args.options = options;
vm_args.ignoreUnrecognized = false;
result = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args); //Exception Occurred
delete options;
try
{
...
}
jvm->DestroyJavaVM();
}
I solved it. There is an exception because there is not enough space for stacks and hips.
© 2024 OneMinuteCode. All rights reserved.