Linking a .so from a java application running on Eclipse

Hi,

I am trying to run a java application that interfaces with native code. So i am using JNI, and the IDE is Eclipse.

I copied the .so files to /lib and to /usr/lib folder. But when running the java application from Eclipse it gives the ‘Unsatisfied link error’, . But in Linux the same this is running cool.

Please help me

Thanks in advance
Sreekanth

add the path of your shared lib to LD_LIBRARY_PATH

Hi,

In the LD_LIBRARY_PATH /lib as well as /usr/lib alreay there .

Thanks
Sreekanth

I guess you compiled your .so under QNX6 and not just copied from Linux!!
Plus you are complying with JNI conventions.

P.S.
try to place your .so file in current directory and start your application as:

j9 -Djava.library.path=. <your_application_class>

If this does not work then check what you call in
System.loadLibrary(“name_of_so_file_without_dot_so”);
Note: let’s say you load System.loadLibrary(“my_library”);
then compiled file should have the name: libmy_library.so

Hi,

I tried with the commad
j9 -Djava.library.path=. <your_application_class> .

Still it is not working .

i have given asd in System.loadLibrary() and libasd.so is there in the current directory

It gives java.lang.UnsatisfiedLinkError : asd (unresolved symbol)
Should i set any environment variable (for eg CLASSPATH)

Thanks
Sreekanth

Try also:
j9 -cp:<path_where_asd_so_resides> <your_application>