JVM invocation with JDK1.4 using JNI

G

Gordon Beaton

I am trying to run the code from:
http://www.codeguru.com/Cpp/misc/misc/interfacingtootherlanguages/article.php/c405/
With JDK1.4 but it fails in the method: "JNI_CreateJavaVM". (return
value -1)

The example uses the 1.1 version of the JNI argument struct, which
changed in 1.2.

http://java.sun.com/j2se/1.4.2/docs/guide/jni/jni-12.html#JNI_CreateJavaVM

Note that when you use the newer struct (described in the JNI
documentation), you don't need to call JNI_GetDefaultJavaVMInitArgs(),
and you should use the symbolic values for the version identifier
(e.g. JNI_VERSION_1_4).

Also make sure that you compiled your application with support for
multiple threads, and that the shared libraries belonging to the JVM
itself can be bound by the application at runtime. Exactly how you do
these things depends on your platform and your compiler.

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top