Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / November 2006

Tip: Looking for answers? Try searching our database.

JNI_GetCreatedJavaVMs() fails

Thread view: 
aa@dsa-ac.de - 22 Nov 2006 14:08 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.