After some discussion, we came to the conclusion that you are having problems configuring the compiler.
To be able to successfully compile and link JNI_CreateJavaVM, you need to add the library jvmto your linker.
Initial answer:
Looking at the Invocation API , the following example might explain what you need to do:
JavaVMInitArgs vm_args;
JavaVMOption options[4];
options[0].optionString = "-Djava.compiler=NONE";
options[1].optionString = "-Djava.class.path=c:\myclasses";
options[2].optionString = "-Djava.library.path=c:\mylibs";
options[3].optionString = "-verbose:jni";
vm_args.version = JNI_VERSION_1_2;
vm_args.options = options;
vm_args.nOptions = 4;
vm_args.ignoreUnrecognized = TRUE;
res = JNI_CreateJavaVM(&vm, (void **)&env, &vm_args);
if (res < 0) ...
source
share