1829666 Members
9536 Online
109992 Solutions
New Discussion

JNI and 64bit

 
<<jdditrc>>
New Member

JNI and 64bit

Hi
I am working on JNI with IA64 HP_UX 11.23 machine. I had my libraries *.so compile and linked successfully but when i try to run, it actually throw
"Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/adm/jni/libSharedLib.so: a specified handle or index is not valid.

I did a print java.library.path before the system.loadlibrary is called and was printed successful. Upon loading the library, it printed the above error.

i compiled with the following cc and linker

cc -Ae +DD64 +u4 -z -c -D_HPUX -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE_EXTENDED -D_PTHREADS_DRAFT4 -DPRODUCTION -I/opt/java1.4/include -I/opt/java1.4/include/hp-ux -I. SharedLib.c

ld -b -o /home/adm/jni/libSharedLib.so SharedLib.o


Additional information:
When i removed +DD64 from the compile statement, the system.loadlibrary("SharedLib") can be loaded successfully (No error thrown). Immediately after this library called i did a println but the error is still thrown after the println call.

Any help will be greatly appreciated.
4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: JNI and 64bit

>-D_PTHREADS_DRAFT4

This is no longer supported, remove it.

>When i removed +DD64 from the compile statement

It seems you are not invoking the 64 bit java?
http://www.hp.com/products1/unix/java/infolibrary/prog_guide/hotspot.html#-d64
<<jdditrc>>
New Member

Re: JNI and 64bit

btw the java version

java version "1.4.2.04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2.04-040628-18:09)
Java HotSpot(TM) Server VM (build 1.4.2 1.4.2.04-040628-23:33-IA64N IA64, mixed mode)
<<jdditrc>>
New Member

Re: JNI and 64bit

Thanks for the help. Problem solved

Dennis Handly
Acclaimed Contributor

Re: JNI and 64bit

>Problem solved

3 points is a little small for solving your problem. ;-)