Sagewire Logo

JNI_GetCreatedJAVAVMs() fails

2 Message(s) by 2 Author(s) originally posted in java machine


From: aa Date:   Wednesday, November 22, 2006
Hello,

I try to start a JAVA virtual machine from a C++
application (Windows XP). I've '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


From: Chris Uppal Date:   Wednesday, November 22, 2006
wrote in message:

I try to start a JAVA virtual machine from a C++
application (Windows XP). I've '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 (application programming interface)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 not see anything obviously wrong with that code. I suspect that the
problem is in something you have not told us yet.

-- chris



Next Message: JNI CallStaticVoidMethod fails after N calls



Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional