a...@[EMAIL PROTECTED]
wrote:
> Hello,
>
> I try to create a Java virtual machine in a C++
> application (Windows XP). I have installed
> jdk1.5.0_08 and I am sure, that my application
> loads the appropriate jvm.dll. Here is my simple
> code, I receive always -1:
>
> ...
> JavaVMOption options[2];
> options[0].optionString = "-Djava.compiler=NONE";
> options[1].optionString = "-Djava.class.path=.";
>
> JavaVMInitArgs args;
> args.version = JNI_VERSION_1_4;
> args.nOptions = 2;
> args.options = options;
> args.ignoreUnrecognized = JNI_FALSE;
> ...
> response = JNI_CreateJavaVM(&mJvm, (void**)&mEnv, &args);
> ...
>
> Can you please say me what is wrong?!
>
> Thanks,
> Anahita
I don't think more than one JavaVM instance can be created per process.
You can use JNI_GetCreatedJavaVMs to determine if you already have one
created, which you should if you're calling a native function from Java.


|