2012-11-12 27 views
1

我已經安裝jpcap並將其添加到庫中,但我在此行中有錯誤:如何使用jpcap抓包?

String [] devices = JpcapCaptor.getDeviceList();

我想我加了錯,因爲它說:Javadoc沒有找到。此項目的Javadoc文檔不存在,或者您沒有在Java Platform Manager或Library Manager中添加指定的Javadoc。

public static void main(String[] args) throws UnknownHostException { 
    // TODO code application logic here 
    String[] devices = JpcapCaptor.getDeviceList(); 
    if(args.length<1){ 
     System.out.println("Usage: java SentUDP <device index (e.g., 0, 1..)>"); 
     for(int i=0;i<devices.length;i++) 
      System.out.println(i+":"+devices[i].name+"("+devices[i].description+")"); 
     System.exit(0); 
    } 

回答