Hello,
I try to start a Java virtual machine from a C++
application (Windows XP). I have 'jdk1.5.0_08'
installed 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 anybody say me what is wrong?!
Thanks,
Anahita
Chris Uppal - 22 Nov 2006 14:46 GMT
> I try to start a Java virtual machine from a C++
> application (Windows XP). I have 'jdk1.5.0_08'
> installed and I am sure, that my application loads
> the appropriate jvm.dll.
Why are you so sure of that ? Are you using the Win32 API functions
LoadLibrary() and GetProcAddress() ? Or are you relying on the Windows %Path%
to do "the right thing" ? Or have you hacked it somehow ?
> Here is my simple code, I
> receive always -1:
> [... snipped... ]
I can't see anything obviously wrong with that code. I suspect that the
problem is in something you haven't told us yet.
-- chris