1
votes

I load the adapter.so that will apply to the other

 public interface CA extends Library {
        CA INSTANCE = (CA) Native.loadLibrary(
                (Platform.isWindows() ? "HashAdapterC" : "adapter"), CA.class);
        int full_hash(byte[] data, long size, int algorithm, byte[] result, IntByReference res_size);
    }

library lie flush

 lib
 |- adapter.so
 |- hal.so

adapter.so refers to hal.so but when calling adapter.so I get an error - Can't found library hal.so

-Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

-jna 3.0.9

-java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

jar compiled with this java(1.7.0_79 64bit)

1
Usually you can use System.loadLibrary() to load the dependency, then the JNA load will work properly.technomage
"/opt/jdk1.7.0_79/bin/java -cp "/usr/testLib/*" -Djava.library.path="/usr/testLib" -Dfile.encoding=UTF-8 net.nvcm.itHash.rmi.server.ItHashServer ItHashServiceProvider 2015" it's command for run....6azbljlb

1 Answers

0
votes

if create symbolic link for .so in directory /usr/lib/ it's working

ln -s /usr/testLib/libHAL.so /usr/lib/libHAL.so
ln -s /usr/testLib/libadapter.so /usr/lib/libadapter.so