How to install jpcap

<Microsoft Windows>

  1. Download and install Java Runtime Environment 6 (if you want to simply run Jpcap-based applications) or JDK 6 (if you want to develop Jpcap-based applications).
  2. Download and install the latest WinPcap.
  3. Download and run Jpcap Self Installer for windows.
If you have the previous version of Jpcap, please uninstall it first before installing a new version.
If you forgot to uninstall the previous version, search 'Jpcap.dll' and 'jpcap.jar' from your system, delete them, and then install a new version.

 

It is recommended to use JRE/JDK 6 or higher because Jpcap installer assumes JRE/JDK 6.
If you are using JRE/JDK 5, set your 'CLASSPATH' to include '%SystemRoot%\Sun\Java\lib\ext'

<Linux>

Use RPM package (Fedora, RedHat)

Download and install Jpcap RPM package.
For some distributions (e.g., Mandriva), JDK6 is also installed automatically.
However, for some distributions (e.g., Fedora Core), you have to manually install Sun's JDK6 for Linux as a RPM package before installing Jpcap RPM package.

Use Debian package (Ubuntu, GNU/Debian)

Download and install Jpcap Debian package.
For some distributions (e.g., Ubuntu), JDK6 is also installed automatically.
For some distributions (e.g., Debian GNU/Lunux), you may have to edit apt-line (e.g., include "no-free") before installing Jpcap Debian package. Also, you may have to update your GLIBC to version 2.4 or higher.

If you cannot install using RPM/Debian package, you can try to build from the source.

It is recommended to use Sun's JRE/JDK 6 or higher because Jpcap package assumes JRE/JDK 6.
If you are using JRE/JDK 5, set your 'CLASSPATH' to include '/usr/java/packages/lib/ext'
Also, Jpcap currently does not work with gcj / gij, so please use Sun's JRE/JDK.

<Mac OS X>

  1. Both Java and libpcap are preinstalled on Mac OS X.
    If any of them is missing you should be able to install them from the Mac OS X install DVD. 
  2. Download and install Xcode.
    The default installation of Xcode should provide you with the toolchain required for compiling Jpcap.
  3. Download and extract Jpcap source build. 
  4. Go to '[Jpcap extracted directory]/src/c' directory. 
  5. Run 'make'.
  6. Copy 'libjpcap.jnilib' to '/Library/Java/Extensions/' directory. 
  7. Copy '[Jpcap extracted directory]/lib/jpcap.jar' to '/Library/Java/Extensions/'
    Or, place 'jpcap.jar' to any directory and include it to your CLASSPATH.


<Source build (Linux/FreeBSD/Solaris)>

  1. Make sure you have 'gcc' and 'make' installed to compile Jpcap.
    Other software/packages may be necessary (for example, you need 'build-essential' package to install on Ubuntu).
  2. Download and install libpcap (ver.0.9.4 or later) if not installed.
  3. Download and extract Jpcap source build.
  4. Go to '[Jpcap extracted directory]/src/c' directory.
  5. Run 'make'.
  6. Copy 'libjpcap.so' to '[Java installed directory]/jre/lib/<arch>'. <arch> is either 'i386' or 'sparc'.
    Or, if you are using Java 6, copy 'libjpcap.so' to '/usr/java/packages/lib/ext'.
    Or, place 'libjpcap.so' in the directory where your application is located.
  7. Copy '[Jpcap extracted directory]/lib/jpcap.jar' to '/usr/lib' or '[Java installed directory]/jre/lib/ext'.
    Or, place 'jpcap.jar' to any directory and include it in your CLASSPATH.

你可能感兴趣的:(Install)