Error:(2, 17) java: package jpcap.net does not exist I added the library file jnetpcap.jar, but the error does not disappear. Compiler intellij idea IDE. Lines
import jpcap.net.JpcapCaptor;
import jpcap.NetworkInterface;
Are red.
import java.net.NetworkInterface;
import jpcap.net.JpcapCaptor;
import jpcap.NetworkInterface;
public class Main
{
jpcap install;
static NetworkInterface[] array ;
public static void main (String[] args)
{
array = JpcapCaptor.getDeviceList();
for (int i=1; i<array.length ; i++)
{
System.out.println(i+" -> " + array[i].description);
}
}
}
您应该将jpcap.dll文件添加到“ system32”文件夹中。
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.