I am trying to create a Java virtual machine in cplusplus using the following code:
JNIEnv *env;
JavaVMInitArgs vm_args;
JavaVMOption options[1];
options[0].optionString = "-Djava.class.path=D:\\Java Src\\TestStruct";
vm_args.version = JNI_VERSION_1_6;
vm_args.nOptions = 1;
vm_args.options = options;
vm_args.ignoreUnrecognized = 0;
int ret = JNI_CreateJavaVM(jvm, (void**)&env, &vm_args);
if(ret < 0)
printf("\nUnable to Launch JVM\n");
I cannot create an instance because it gives me the following error. I can compile, but it gives a runtime error like this.
Error: Error initializing the virtual machine. Unable to load own library: cannot find dependent libraries
Can someone help me in advance :)
source
share