2

I am trying to run simple program using jnetpcap library in CentOS maching but its giving: java.lang.UnsatisfiedLinkError: /usr/lib/libjnetpcap.so: libpcap.so.0.9: cannot open shared object file: No such file or directory.

I have put "libjnetpcap.so" downloaded from jnetpcap-1.3 Linux (Generic) inside "/usr/lib" and also set LD_LIBRARY_PATH=/usr/lib.

Please help me, what can be the reason?

Mohit Jain
  • 357
  • 2
  • 7
  • 18
  • Try putting the .so file in a separate directory (i.e., /home/user/jnetpcap-1.3) and passing it directly to your java program: java -Djava.library.path=/home/user/jnetpcap-1.3 YourApplication – Ben Damer Aug 01 '16 at 17:30

1 Answers1

0

I solved the issue by simply renaming the libpcap.so.1.7.4 (installed from ubuntu package manager) that I had in my lib folder (usr/lib/x86_64-linux-gnu) into libpcap.so.0.9.

Antonio La Marra
  • 5,949
  • 4
  • 15
  • 23