Trying to write a network packet sniffer using jpcap in eclipse. At runtime i get this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: jpcap.JpcapCaptor.getDeviceList()[Ljpcap/NetworkInterface;
at jpcap.JpcapCaptor.getDeviceList(Native Method)
at pktSniffer.main(pktSniffer.java:20)
import jpcap.*; import jpcap.packet.Packet; import jpcap.PacketReceiver; public class pktSniffer implements PacketReceiver { public void receivePacket(Packet packet){ System.out.println(packet); } public static void main(String[] args) throws java.io.IOException{ NetworkInterface[] lists=jpcap.JpcapCaptor.getDeviceList(); System.out.println("\n\t\t***Network Sniffer***\n"); System.out.println("Found the following devices : "); for(NetworkInterface s: lists) { System.out.println("Name: " + s.name +" Description: " + s.description); } JpcapCaptor jpcap=JpcapCaptor.openDevice(JpcapCaptor.getDeviceList()[1],1000,false,20); jpcap.loopPacket(-1,new pktSniffer()); } }