Jpcap configuration method, problem solving, simulation sniffer program. (with Java program, Jar,dll package and other environment)

Source: Internet
Author: User

Blog Link http://www.cnblogs.com/xckk/p/4609444.html

I. Installation and configuration of the eclipse environment Jpcap

Related source programs, Jpcap jar packages, DLL packages, help documentation.

has been stored in the Baidu cloud disk, the link is as follows: Http://pan.baidu.com/s/1o6JxcIQ

can also be downloaded in csdn, link as follows: http://download.csdn.net/detail/hk276506076/8852913

1. Download and install WinPcap

2, Jpcap official documents in the LIB package, there are two files, Jpcap.dll and Jpcap.jar.

Jpcap.dll-->java Installation path/jre1.6.0_06/bin (JRE directory)

Jpcap.jar-->java Installation path/jre1.6.0_06/lib/ext (JRE directory) and Java installation path/jdk1.6.0_05/jre/lib/ext (JDK directory)

3. Eclipse adds Jpcap.jar package. windows->preferences->java->installed jres-> Select JDK and input edit button-->add external jars

Add the Jpcap.jar package, even if the configuration is complete. The problems that occur in the configuration are resolved in the second step.

Second, the configuration Jpcap problems

Refer to several blog posts, links are as follows http://blog.csdn.net/fykhlp/article/details/6159195

Some can be solved, some can't. Here, anti-oneself encountered problems and solutions listed, for your reference.

1, Jpcap related Java class can not find.

Although the Jpcap.jar library has been added to the JRE Libray library, it is still a hint that it cannot be found. Delete and re-import the JRE.

Method: Right-click your project->properties->java buildpath->remove and then import

2, Error: "No dependence Library", it is probably not installed WinPcap

3, the most common java.lang.UnsatisfiedLinkError:no jpcap in Java.library.path.

The error message is that Jpcap.dll is not found in the Java library path. You can find the path of the library by following the code below.

System.out.println (System.getproperty ("Java.library.path"));

The discovery path already includes my Jre/bin directory. It's still not working. There are many ways to say it online, but I still can't do it in my project.
By printing the path of the library. Discover that the first path is your own Jdk/bin directory. Copy the Jpcap.dll to the Jdk/bin. The problem is solved. As to why this is so, it is not clear.

4, the 3rd step after the resolution, appeared Java.lang.UnsatisfiedLinkError:jpcap. Jpcapcaptor.getdevicelist () [Ljpcap/networkinterface this error.

It is possible that the Jpcap.dll package and the Jpcap.jar package are incompatible. There are compatible packages in my cloud disk, please download. Http://pan.baidu.com/s/12k6M6

Third, the JPCAP test procedure, simulates the sniffer. Implement different protocols for grasping packets, writing files and reading files.

has been stored in the Baidu cloud disk, the link is as follows: Http://pan.baidu.com/s/1o6JxcIQ

can also be downloaded in csdn, link as follows: http://download.csdn.net/detail/hk276506076/8852913

SOURCE program Project: Test_jpcap2.rar.

Main program: Mainconsole.java

Scholar Kun kun produced blog link http://www.cnblogs.com/xckk/p/4609444.html

SOURCE program Simulation CSDN The resources uploaded by a friend, I made improvements. http://download.csdn.net/detail/chuanhua_seu/3973925

Jpcap configuration method, problem solving, simulation sniffer program. (with Java program, Jar,dll package and other environment)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.