简体   繁体   中英

JpcapCaptor, NetworkInterface in Jpcap package

I have dowloaded a jpcap package from http://sourceforge.net/projects/jpcap/ I have copied the jar file in ext of jre and jdk and also copied the folder in bin of jdk. but when i run my code it shows a error of JpcapCaptor and Network Interface class not found.

I have also searched manually in my package and there is no class named JpcapCaptor. Please help me if i had installed a wrong package or what?

yes there is no class named JpcapCaptor in 0.01.16 version. and your problem about the network interface not found is because PacketCapture.getDevice is adding \\n and other string (like window) to the device name, which make it unreadable when you are trying to open the device so try compare the device name with the one you can find by using ipconfig in the Command prompt and erase the extra string using substring. you can use code when you open the device:

     PacketCapture pcap=new PacketCapture();
     String device=pcap.findDevice();
     device=device.substring(0, device.indexOf("}")+1);
     m_pcap.open(device, true);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM