Installation of JNetPcap is dependent on the installation of WinPcap Library (The libpcap library for Windows).
Now Once the WinPcap Setup is installed, you can now download the binaries required for the download of JNetPcap.
(Note: Is it advised that 32 bit Eclipse Users also download the 32 bit version of Download Package(x86 version)).
Once all three files are downloaded. UNPACK them into a preffered location so that they can be easily linked with the Eclipse IDE
- Copy the jnetpcap.dll to both windows/system and windows/system32 (to be on the safe side)
- Now open Eclipse as Administrator.
- Go to Window->Prefrences
- Java->Build Path-> User Libraries
- Select “New”
- Name the Library “JNetPcap”
- Then Add Jar file i.e “jnetpcap.jar” from the download package folder.
- Expand the Jar file “jnetpcap.jar”
- Click on Source attachment and Select “Edit”. After that select the folder in which the source files are present e.g “jnetpcap-src-1.3.0-1″.
- Click on Java Doc location and Select “Edit”.After that select the folder in which the java docs are present e.g “jnetpcap-javadoc-1.3.0-1″.
- Now select Native Library location and Select “Edit”. Select the folder where the initial Download Package is present.(In which the “include” folder is present).
- Select OK.
configure JnetPcap in java project
- right click your project name (for example "capture")
- select "build path"->"configure build path..."
- select Libraries,select "jnetpcap.jar"
- click ok
Then, you will see "jnetpcap.jar" in Referenced Libraries. Now jnetpcap is include in your project
You have successfully installed JNetPcap. Now all you have to do is include the User library in your project.