T
Tim
I notice that there is another poster with a similar problem to mine,
but he's on Unix and I am on Windows, and I think there may be a
setup/config problem, so I am starting a new thread
I am also getting an error creating the JVM, I am using j2sdk1.4.2_04
with MSDEV 6.0 and have cut'n'pasted about three different pieces of
sample code ( I won't post loads of code here) from working examples
found on the web, they all fail on the call to JNI_CreateJavaVM with an
error code of -1
I am wondering is there are any common setup problems, perhaps having
dlls in the wrong place of environment variables set wrongly, that
might be a cause of this problem?
Here is an example of one code sample I tried that did not work.
Incidentally if I set the version wrong, I get a different error code
(-3, which is to indicate wrong version)
jint ret;
JavaVM* jvm;
JNIEnv* env;
JavaVMInitArgs args;
JavaVMOption options[1];
args.version = JNI_VERSION_1_2;
args.nOptions = 1;
options[0].optionString = "-Djava.class.path=c:\\";
args.options = options;
args.ignoreUnrecognized = JNI_FALSE;
ret = JNI_CreateJavaVM(&jvm, (void **)&env, &args);
but he's on Unix and I am on Windows, and I think there may be a
setup/config problem, so I am starting a new thread
I am also getting an error creating the JVM, I am using j2sdk1.4.2_04
with MSDEV 6.0 and have cut'n'pasted about three different pieces of
sample code ( I won't post loads of code here) from working examples
found on the web, they all fail on the call to JNI_CreateJavaVM with an
error code of -1
I am wondering is there are any common setup problems, perhaps having
dlls in the wrong place of environment variables set wrongly, that
might be a cause of this problem?
Here is an example of one code sample I tried that did not work.
Incidentally if I set the version wrong, I get a different error code
(-3, which is to indicate wrong version)
jint ret;
JavaVM* jvm;
JNIEnv* env;
JavaVMInitArgs args;
JavaVMOption options[1];
args.version = JNI_VERSION_1_2;
args.nOptions = 1;
options[0].optionString = "-Djava.class.path=c:\\";
args.options = options;
args.ignoreUnrecognized = JNI_FALSE;
ret = JNI_CreateJavaVM(&jvm, (void **)&env, &args);