style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-7505528228218001"
data-ad-slot="1225241371">

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jnetpcap in java.library.path

1 reply [Last post]
pras
Offline
Joined: 08/29/2016

Trying to read the pcap file and dump the GPS location related information into a text file
I'm using Eclipse (Eclipse Java EE IDE for Web Developers. Version: Mars.1 Release (4.5.1) Build id: 20150924-1200 )
on windows 7 (SP1) 64 bit Operating system

Downloaded jnetpcap.jar file for 1.3 version for for both 32 and 64 and tried the following code
installed the jar file from Eclipse->project->properties->java buidd path-> Libraries and added the jar file (as explained in one of the options on this site)

public static void main(String[] args) {
final String FILENAME = "c://some.pcap";

final StringBuilder errbuf = new StringBuilder();

final Pcap pcap = Pcap.openOffline(FILENAME, errbuf);
}

in both cases, I'm getting the followimg error
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jnetpcap 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 org.jnetpcap.Pcap.(Unknown Source)
at PCAPTestParser.main(PCAPTestParser.java:20)

What am I doing wrong?

Please help

Mark Bednarczyk
Offline
Joined: 03/22/2008
In you "build path" you also

In you "build path" you also need to specify the "native directory" location for jnetpcap.jar file. If you expand the library entry within eclipse dialog you will find the property there, along side javadocs location, etc...

Sly Technologies, Inc.
http://slytechs.com

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.