The program returns with -1 (unknow error). How can I get some more detailed information on what is the problem ? Did anyone make the same experience ? Regards, Tobias
Joined: Nov 12, 2001
Originally posted by lichade xun: Isn't something missing from your options setting? options.optionString = "-Djava.class.path=.:<where rt.jar>"; LX
Hi, that doesn't work either. Do you need to add this in the option part ? I thought that the "JavaHome" value in the registry was used to find the runtime classes. Regards, Tobias
Joined: Dec 29, 2005
i know, the answer is most likely a bit late (first post was 2001 , the reason why i am answering is, that there has not been a possible solution to the symptom JNI_CreateJavaVM() returning -1 which solved my problem.
in my case jvm.dll must be kept in its installation directory. so don't just copy jvm.dll into the same directory of your JNI-application! it seems that jvm.dll is somehow using paths relative to its directory of java installation dir.
that means, that you need to set $PATH (or another appropriate env-var) to the directory where jvm.dll sits (JAVA_INSTALL_DIR/jre/bin/client/) so the system finds the jvm.dll when it is needed from your app.