J
jimw
I previously posted this but hopefully I deleted it. This is a re-post.
On Linux, I'm having some problems with using Java/JNI from a C++ program
(actually
all C, just compiled as C++ with .cpp extension).
Using this JVM shared library:
/usr/java/jdk1.3.1_03/jre/lib/i386/server/libjvm.so - had to use the server
because if I use the client, I get the unresolved symbol "jdk_sem_post".
Read somewhere on the net that I should use the server version instead of
classic in order to avoid this issue.
I am able to resolve to libjvm.so and the symbol JNI_CreateJavaVM, but when
I call to create my VM, I get the following messages in my callback routine.
Error occurred during initialization of VM
Unable to load native library
libjvm.so: cannot open shared object file: No such file or directory
I'm thinking that libjvm.so has some dependency that is not being fulfilled,
but what????
"ldd libjvm.so" shows the following:
libnsl.so.1 => /lib/libnsl.so.1 (0x404fc000)
libdl.so.2 => /lib/libdl.so.2 (0x40513000)
libpthread.so.0 => /lib/libpthread.so.0 (0x40516000)
libstdc++-libc6.1-1.so.2 => /usr/lib/libstdc++-libc6.1-1.so.2
(0x4052c000)
libm.so.6 => /lib/libm.so.6 (0x4056e000)
libc.so.6 => /lib/libc.so.6 (0x4058e000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
A "strings libjvm.so" shows only the above .so files and also libhpi.so,
which
is apparently the native or green threads version. I also tried adding the
location of native_threads/libhpi.so to LD_LIBRARY_PATH and still no help.
My linus is a fairly old RedHat.
A uname shows "Linux linus 2.2.16-22 #11 SMP Tue Oct 2 18:02:55 EDT 2001
i686 unknown"
I link with "-lm -ldl -lbsd -lpthread"
The same code works OK on Win2K and also on Solaris 8.
I have standalone Java only code which is able to do JNDI and JMS with no
problem on this Linux machine.
Thanks for any help - I'm kinda baffled.
Jim
On Linux, I'm having some problems with using Java/JNI from a C++ program
(actually
all C, just compiled as C++ with .cpp extension).
Using this JVM shared library:
/usr/java/jdk1.3.1_03/jre/lib/i386/server/libjvm.so - had to use the server
because if I use the client, I get the unresolved symbol "jdk_sem_post".
Read somewhere on the net that I should use the server version instead of
classic in order to avoid this issue.
I am able to resolve to libjvm.so and the symbol JNI_CreateJavaVM, but when
I call to create my VM, I get the following messages in my callback routine.
Error occurred during initialization of VM
Unable to load native library
libjvm.so: cannot open shared object file: No such file or directory
I'm thinking that libjvm.so has some dependency that is not being fulfilled,
but what????
"ldd libjvm.so" shows the following:
libnsl.so.1 => /lib/libnsl.so.1 (0x404fc000)
libdl.so.2 => /lib/libdl.so.2 (0x40513000)
libpthread.so.0 => /lib/libpthread.so.0 (0x40516000)
libstdc++-libc6.1-1.so.2 => /usr/lib/libstdc++-libc6.1-1.so.2
(0x4052c000)
libm.so.6 => /lib/libm.so.6 (0x4056e000)
libc.so.6 => /lib/libc.so.6 (0x4058e000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
A "strings libjvm.so" shows only the above .so files and also libhpi.so,
which
is apparently the native or green threads version. I also tried adding the
location of native_threads/libhpi.so to LD_LIBRARY_PATH and still no help.
My linus is a fairly old RedHat.
A uname shows "Linux linus 2.2.16-22 #11 SMP Tue Oct 2 18:02:55 EDT 2001
i686 unknown"
I link with "-lm -ldl -lbsd -lpthread"
The same code works OK on Win2K and also on Solaris 8.
I have standalone Java only code which is able to do JNDI and JMS with no
problem on this Linux machine.
Thanks for any help - I'm kinda baffled.
Jim