1.5.2 - Debian/ubuntu

Commands to install development environment on a blank uBuntu install:

Executed as root (user "mark" is only used as an example, replace with your own username):

  1. apt-get install openjdk-6-jdk
  2. apt-get install libpcap-dev
  3. apt-get install g++
  4. apt-get install ant (pulls in about 25Mb of other packages)
  5. apt-get install ant-optional (needed for "javah" task)
  6. (optional) install junit for running the ant "test" target
    apt-get install junit
  7. apt-get install subversion
  8. (optional) Create user if you don't have an account (use your own user name):
    useradd -m mark
    and assign a password:
    passwd mark
  9. su - mark
  10. Checkout source code (complete details):
    svn co https://jnetpcap.svn.sourceforge.net/svnroot/jnetpcap/jnetpcap/trunk jnetpcap


    svn checkout https://svn.code.sf.net/p/jnetpcap/code/jnetpcap/trunk jnp_1.4
  11. setenv JAVA_HOME /usr/lib/jvm/java-1.6.0-openjdk
  12. As root run jUnit testcases to make sure everything compiles correctly. Tests need to be run as root, as some of the tests check interface parameters that require root privilege:
    ant clean test
    #if everything tested OK
  13. from the jnetpcap SVN working directory invoke the "package-deb" target which will compile the shared library and all the java classes. Output is under "dist/" directory.
    ant -Dos=ubuntu9 clean package-deb
  14. dpkg -i dist/jnetpcap-1.3.b0003-ubuntu9.i386.deb
  15. ls -l /usr/lib/libjnetcap*
    lrwxrwxrwx 1 root root      33 Jul 4 17:33 /usr/lib/libjnetpcap.so -> /usr/lib/libjnetpcap.so.1.3.b0003
    -rw-r--r-- 1 root root 1193147 Jul 4 17:29 /usr/lib/libjnetpcap.so.1.3.b0003
  16. ls -l /usr/share/java/jnetpcap*
    -rw-r--r-- 1 root root 463175 Jul 4 17:29 /usr/share/java/jnetpcap-1.3.b0003.jar
    lrwxrwxrwx 1 root root     38 Jul 4 17:33 /usr/share/java/jnetpcap.jar -> /usr/share/java/jnetpcap-1.3.b0003.jar
  17. ls /usr/share/doc/jnetpcap*

Other names that should be used with the "-Dos=" argument to ant during build. You can substitute the major OS version number at the end:

  1. debian3 - for Debian OS
  2. ubuntu9 - for ubuntu OS
  3. gentoo2008 - for Gentoo 2008.X OSs

This example assumes that we are taking a snapshot of the latest state of the development trunk (SVN trunk) which is assigned a build number (defined in file build.number in jnetpcap working directory). Build numbers are incremented after each official or internal build by jnetpcap builders.