一个简单的关于网卡的问题,为什么出异常,请教高手
public class checkwangka {public static void main(String [] args) throws Exception
{
NetworkInterface[] devices = JpcapCaptor.getDeviceList();
int index = 0;
if(devices.length>1)/*去掉虚拟网卡的处理*/
index = 1;
JpcapCaptor captor = JpcapCaptor.openDevice(devices[index], 65535, false, 20);
captor.loopPacket(-1, new Receiver());
}
}
class Receiver implements PacketReceiver
{
/*实例receivePacket方法*/
public void receivePacket(Packet packet)
{
/*进行简单的处理*/
System.out.println(packet);
}
}
java.lang.UnsupportedClassVersionError: jpcap/PacketReceiver (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at (Unknown Source)
at (Unknown Source)
at (Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at (Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main"