Jpcap is a Java class package that allows Java applications to capture and/or send packets to the network.

Jpcap is based on libpcap/winpcap and Raw Socket API. Therefore, Jpcap is supposed to work on any OS on which libpcap/winpcap has been implemented. Currently, Jpcap has been tested on FreeBSD 3.x, Linux RedHat 6.1, Fedora Core 4, Solaris, and Microsoft Windows 2000/XP.

Jpcap supports the following types of packets: Ethernet, IPv4, IPv6, ARP/RARP, TCP, UDP, and ICMPv4. Other types of packets are captured as raw packets (i.e., instances of the Packet class) which contains the whole data of the packets. This allows Java applications to analyze unsupported packet types.

What’s New
4/22/06 Jpcap ver.0.5.1 is released. This contains several bug fixes. See ChangeLog in detail.
1/6/06 Jpcap ver.0.5 is released under LGPL.
4/9/03 Bug fix on Jpcap.openFile() and JpcapWriter.
4/1/03 New homepage. Jpcap ver.0.4 was released.
9/14/00 Jpcap ver.0.3 is released ARP/RARP supported.Many important bug fix.
7/29/00 Jpcap ver.0.2 is released. Now MS Windows are supported.

< Windows 9x, NT, 2000, xp >
1.Download and install Javatm2 Platform, Standard Edition (J2SEtm) JRE or JDK.
2.Download and install the latest WinPcap.
3.Download and run Self Installer.
4.Follow the instruction of the installer.
If you do not want to use the installer, you can also install manually.
1.Download and extract the Jpcap source code from the Download page.
2.Copy "lib\Jpcap.dll" into "[JRE directory]\bin" or "[JRE directory]\lib\ext\x86"
3.Copy "lib\jpcap.jar" into "[JRE directory]\lib\ext"
4.If you installed JDK, you also need to copy "lib\jpcap.jar" into "[JDK directory]\jre\lib\ext".
   Note: [JRE directory] is usually "C:\Program Files\Java\j2re*".
   [JDK directory] is usually "C:\Program Files\Java\jdk*".

< UNIX >
1.Download and install Javatm2 Platform, Standard Edition (J2SEtm) JRE or JDK
2.Download and install libpcap if not installed.
   Note: Jpcap ver.0.5 requres libpcap 0.9.4 or later.
3.Download and extract the latest Jpcap
4.Go to "src/c" directory, and edit Makefile 
5.Run "make".
   If you get an error "structure has no member named `sa_len’",
   comment out the line "#define HAVE_SA_LEN" in Jpcap_sub.h.
6.Copy to [Java directory]/jre/lib/<arch>. <arch> is either "i386" or "sparc"
7.Copy "lib/jpcap.jar" into [Java directory]/jre/lib/ext.



Self Installer

Source code

Jpcap ver.0.5.1

Installer for Windows

Jpcap ver.0.5

Jpcap ver.0.4

Jpcap ver.0.3