 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Wed Nov 22, 2006 8:08 pm Post subject: JNI_GetCreatedJavaVMs() fails |
|
|
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 |
|
| Back to top |
|
 |
Chris Uppal Guest
|
Posted: Wed Nov 22, 2006 8:46 pm Post subject: Re: JNI_GetCreatedJavaVMs() fails |
|
|
aa@dsa-ac.de wrote:
| Quote: | 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 ?
| Quote: | 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 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|