AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

JNI_GetCreatedJavaVMs() fails

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Wed Nov 22, 2006 8:08 pm    Post subject: JNI_GetCreatedJavaVMs() fails Reply with quote



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





PostPosted: Wed Nov 22, 2006 8:46 pm    Post subject: Re: JNI_GetCreatedJavaVMs() fails Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.