java.lang.UnsatisfiedLinkError: no HelloWorldImp in java.library.path
843829Apr 2 2007 — edited Jul 17 2007Hello,
I have written a small C function to display HelloWorld message. I am calling the C function from a java program through JNI.
The program is working fine under HP UX 11.11 system. But the program is not working under HP-UX11.23(v2).
Could you please let us know why this is happening?
Please find the steps I followed in detail:
i) a sample java class with a native method declaration
ii) a C function which displays HelloWorld message
iii) compiled the java file
iv) generated header file with javah tool
v) compiled the C function
vi) created the shared library
Note: The same steps are being followed in both the machines
Compiling options:
/usr/bin/cc -Ae u4 -D_HPUX -c DA1.1 +z -I. -I/opt/java1.4/include -I/opt/java1.4/include/hp-ux HelloWorldImp.c HelloWorldImp.o
command used to create shared library:
/usr/bin/ld -b -o ./libHelloWorldImp.sl ./HelloWorldImp.o
vii) exported SHLIB_PATH
Any help in this regard will be more helpful.
Please let us know in case of any change in compiler options. Please let me know in case of any questions.
Thanks and Regards,
Jnanprasad