Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2010
    Posts
    1
    Rep Power
    0

    Default After installing jpcap, how to run the java program ?!

    Hi everyone,
    I had installed the jpcap(including the winpcap),after installing
    these, I'm clueless on how to run the java program which utilises
    these functionalities.
    consider the following code,
    Java Code:
     
    public class JpcapTip implements JpcapHandler 
    { 
            public void handlePacket(Packet packet) 
            { 
                    System.out.println(packet); 
            } 
     }
    when i compiled this code in command prompt,
    got errors like the following,
    C:\Program files\java\jdk1.6.0_23\bin>javac JpcapTip.java

    JpcapTip.java:1: cannot find symbol
    Symbol: class JpcapHandler
    public class JpcapTip implements JpcapHandler

    JpcapTip.java:3: cannot find symbol
    Symbol: class Packet
    location: class JpcapTip
    public void handlePacket(Packet packet)
    2 errors

    C:\Program files\java\jdk1.6.0_23\bin>
    I guess my way of running the java program is wrong.
    Can anyone please guide the right way of compiling and running the
    Jpcap programs.!
    Please its quite urgent.!

  2. #2
    ryanplawrence is offline Member
    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0

    Default Re: After installing jpcap, how to run the java program ?!

    I am having similar problems with jpcap. i installed jpcap along with winpcap and i can't get it
    to open my file.

    my code:

    package project0;

    import jpcap.*;
    import jpcap.packet.*;
    /**
    *
    * @author Ryan
    */


    public class Project0 {

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    // TODO code application logic here
    JpcapCaptor captor=null;
    try{
    captor=JpcapCaptor.openFile("capture.tmp");
    } catch (Exception e) {
    // we should do something with the exception.
    System.out.println("Error opening file " + "capture.tmp ");
    return;
    }

    while(true){
    //read a packet from the opened file
    Packet packet=captor.getPacket();
    //if some error occurred or EOF has reached, break the loop
    if(packet==null || packet==Packet.EOF) break;
    //otherwise, print out the packet
    System.out.println(packet);
    }

    captor.close();

    }
    }

    getting error on import jpcap.*;
    and not recognizing .EOF

    will not open file
    i already added .jar to my project lib and netbeans lib

    i have no clue please help!

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,884
    Rep Power
    25

    Default Re: After installing jpcap, how to run the java program ?!

    Have you asked this question about how to configure your IDE in a forum for your IDE?

Similar Threads

  1. Installing Java libraries
    By DC200 in forum New To Java
    Replies: 13
    Last Post: 03-21-2010, 06:58 AM
  2. Installing a new Java Package
    By tyang in forum New To Java
    Replies: 8
    Last Post: 02-24-2010, 06:22 PM
  3. Need Help installing java - can you help me?
    By Menre in forum New To Java
    Replies: 4
    Last Post: 02-22-2010, 01:33 PM
  4. about using jpcap
    By prashant in forum Networking
    Replies: 1
    Last Post: 12-28-2008, 05:28 PM
  5. Installing Java
    By Adv3nt in forum New To Java
    Replies: 3
    Last Post: 12-13-2007, 12:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •