(Note: this is temporary document with some basic information. More comprehensive document is under development)
jNetPcap library is composed of 2 components. The shared native library written in C++ language and the java code that is bound to it using java's JNI extensions.
Source code can be acquired from a downloaded distribution package or from SVN repository on SourceForge.net servers.
For exmple to checkout the latest from the development trunk:
svn co https://jnetpcap.svn.sourceforge.net/svnroot/jnetpcap/jnetpcap/trunk jnetpcapAs of development build 1.3.b0005, source files are no longer provided with the binary distribution of jNetPcap. Sources now reside in their own sperate packages such as RPMS or as -src for platforms that do not support specialized source packaging.
In order to compile complete jNetPcap software you will need both C++ compiler and java development environments installed. When all the prerequisites and needed tools are installed in your environment, the compilation stage is simply execution of ANT script for "compile" or one of the "package" targets. There are no makefiles, all software is compiled using ant and various optional tasks.
In general the following prerequisites need to be installed before jNetPcap can be compiled.
Once this minimum set of prerequisites is installed you can run "ant compile" on the command line.
In addition to the common requirements, in order to be able to build RPM packages on various linux flavors the following is also required:
The java rpm ant task is already located in the jnetpcap distributed lib directory and is referenced directly from the build file. It does not need to be installed by default.
The supported debian based environments already come with required packaging development support. This is comprable to
The java deb ant task required to perform the debian build, is already located in the jnetpcap distributed lib directory and is referenced directly from the build file. It does not need to be isntalled by default.
jNetPcap bulids are not compatible with GNU java compiler gcj which is commonly and easily installed on various OS flavors. The incompatiblity is with JNI generated header files using javah command. GNU javah compiler mangles names of constants exported from java class files to JNI header files.
Name mangling, or making a name unique, is very common when using JNI mappings for C/C++ function names that are mapped to java native methods. However, GNU javah compiler also mangles the names of the constants that are exported to header files. This is different from the behavior of Sun provided JDK. This behavior is unportable between platforms. Therefore jNetPcap native library code can not be compiled with GNU javah compiler.