2

ubuntu 2.04のnetbeanでこのコードを実行すると、以下のエラーが表示されます

    import java.io.IOException;
    import jpcap.JpcapCaptor;
    import jpcap.NetworkInterface;
    import jpcap.NetworkInterfaceAddress;
    import jpcap.packet.Packet;

      public class JavaApplication1 {
      public static void main(String[] args){
      printNetworkInterfaces();
  captureFromNetworkInterface();
                                       }

  public static void printNetworkInterfaces(){
    System.out.println("Obtain the list of network interfaces");

      NetworkInterface[] devices = JpcapCaptor.getDeviceList();
         for (int i = 0; i < devices.length; i++) {
          System.out.println(i+": "+devices[i].name + "("  
               +devices[i].description+")");
       System.out.println(" datalink: "+devices[i].datalink_name + "(" +     
       devices[i].datalink_description+")");

    System.out.print(" MAC address:");
    for (byte b : devices[i].mac_address)
    System.out.print(Integer.toHexString(b&0xff) + ":");
     System.out.println();
    for (NetworkInterfaceAddress a : devices[i].addresses)
    System.out.println(" address:"+a.address + " " + a.subnet +""+ a.broadcast);
    }
    }

     public static void captureFromNetworkInterface(){
     NetworkInterface[] devices = JpcapCaptor.getDeviceList();
     int index=0;  

//Open an interface with openDevice(NetworkInterface intrface, int snaplen, boolean 

     promics, int to_ms)
    try {
        JpcapCaptor captor=JpcapCaptor.openDevice(devices[index], 65535,  
                    false, 20);
        for(int i=0;i<10;i++){


            //capture a single packet and print it out
            Packet packet = captor.getPacket();
            if(packet!=null)
            {
                System.out.println("Packet " + i + ": ");
                System.out.println("     length - " + packet.len);
                System.out.println("     captured timestamp - " + 
                                    packet.sec);
            }
        }
        captor.close();
    } catch (IOException e) {
    }

           }*/
     }

エラーは

/usr/lib/jvm/java-6-openjdk-i386/jre/lib/netx.jar のファイルがありません

/usr/lib/jvm/java-6-openjdk-i386/jre/lib/plugin.jar のファイルがありません

4

0 に答える 0