Problem with the libjpcap.so when using with java.(UnsatisfiedLinkError:nativeOpenOffline)

Sir,
I am trying to open pcap file using the methods in a library(jpcap.jar). I download libjpcap.so and added the path of this file to the LD_LIBRARY_PATH at the run time of my java class.I am getting the following error.
Please suggest how to proceed on this.
Exception in thread "main" java.lang.UnsatisfiedLinkError: nativeOpenOffline
        at jpcap.JpcapCaptor.nativeOpenOffline(Native Method)
        at jpcap.JpcapCaptor.openFile(JpcapCaptor.java:84)
        at Pcaptest.main(Pcaptest.java:15)
My source file is something like :

import java.io.IOException;
import jpcap.JpcapCaptor;
import jpcap.packet.Packet;
public class Pcaptest {
        public static void main(String[] args) {
        try{
       JpcapCaptor jpc = JpcapCaptor.openFile("/root/trace1.pcap");
       System.out.print(jpc.getPacket());
       Packet pkt = jpc.getPacket();
       System.out.println("Packet header : "+pkt.header);
           }catch(IOException exc){
                exc.printStackTrace();
                }
        }
}
Thanks
- Prahlad
prahlad_kgpAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

WelkinMazeCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
amol_chaudhariCommented:
hi
u have downloaded the object file which is library for linux native environment....
to use .so file as an library see native method interface in java (u can get enough abt JNI and how to use it in Java complete reference book)

to use this try to put line
System.loadLibrary("/*path of ur .so file*/");
in main befor accessing or declaring any member frm jar file
 e.g.

import java.io.IOException;
import jpcap.JpcapCaptor;
import jpcap.packet.Packet;
public class Pcaptest {
        public static void main(String[] args) {
        try{
        System.loadLibrary("libjpcap.so");
       JpcapCaptor jpc = JpcapCaptor.openFile("/root/trace1.pcap");
       System.out.print(jpc.getPacket());
       Packet pkt = jpc.getPacket();
       System.out.println("Packet header : "+pkt.header);
           }catch(IOException exc){
                exc.printStackTrace();
                }
        }
}

may be this help
bye
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.