标题:一个简单的关于网卡的问题,为什么出异常,请教高手
只看楼主
xyh_gk
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-5-17
 问题点数:0 回复次数:0 
一个简单的关于网卡的问题,为什么出异常,请教高手
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"
搜索更多相关主题的帖子: 网卡 captor Receiver JpcapCaptor 
2008-05-17 22:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-214823-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.308970 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved