Skip to main content

jpcap package cannot be resolved in eclipse

In linux:

in terminal -> locate jpcap
you'll find "/usr/java/packages/lib/ext/jpcap.jar" (only if your jpcap is properly installed)

Add it as an external jar for your project and jpcap will work in eclipse.
Note: you should have admin previliges

Comments

  1. I am getting run time errors as
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no jpcap in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at jpcap.JpcapCaptor.(JpcapCaptor.java:251)
    at pac.pac2.Router.main(Router.java:31)


    So how to over come them.
    only jar file of jpcap is enough or need to install any ohter files.
    working in ellipse to capture the packets

    ReplyDelete
  2. only jar file needs to be installed because it contains all the archived files required. You can check it in your system by typing "locate jpcap" in terminal. Place externally if it doesn't work for you.(in eclipse you need to add it externally)
    Hope it helped.

    ReplyDelete

Post a Comment

Popular posts from this blog

VBA MAcro to generate "table of contents with hyperlinks" automatically in a ppt

VBA MAcro to generate "table of contents with hyperlinks" automatically in a ppt: Function TableOfContent(count As Integer) 'count is the no. of slides in ppt Dim var As Integer Dim i As Integer, scount As Integer Dim strSel As String, strTitle As String, strb As String, strtemp As String, str As String Dim arr() As String Dim index As Integer, indexcount As Integer, slidecount As Integer Dim summary As Slide Dim para As Integer Dim slideOrder() As Integer 'To generate the Table of contents slide ReDim slideOrder(count - 2) 'Collect all the IDs of the selected slides For i = 1 To count - 2 slideOrder(i) = i + 2 Next 'Iterate over the slides in Index order slidecount = UBound(slideOrder) For scount = 1 To slidecount If ActivePresentation.Slides(slideOrder(scount)).Shapes.HasTitle Then 'Build up the ToC Text strTitle = ActivePresentation.Slides(slideOrder(scount)).Shapes("UseCase").TextFrame.TextRange.Text + ": &qu

Filter packets through jpcap

//Open an interface with openDevice(NetworkInterface intrface, int snaplen, boolean promics, int to_ms) JpcapCaptor captor=JpcapCaptor.openDevice(devices[index], 65535, false, 20); captor.setFilter("tcp && src port 6000", true); It'll filter all the TCP packets with source port number 6000. So, all we need to do is pass the parameters and use logical and, or operators.

redis server went away

It feels really awkward to see " redis: uncaught exception: Redis server went away " when it was working and suddenly this message bumps up. I faced the same situation while accessing php redis but I guess it's more generic one, more related to redis. So, here are possible solutions that I am able to find and highlighting the one which really did work for me. 1. /usr/sbin/setsebool httpd_can_network_connect=1 By default, SELinux does not allow Apache to make socket connections. So, enable the connection. 2. Try to stop the redis server and restart it again. either of these two should work: a) redis-cli b) redis server 3. There might be issues with switch, try to use different switch.