Link to home
Start Free TrialLog in
Avatar of Mach70803
Mach70803

asked on

Getting Jpcap to work in linux

Has anyone sucessfully installed this library?  What did you have to add to your classpath to get the examples to work?
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Personally no. What problems are you having?
> What did you have to add to your classpath to get the examples to work?

nothing, just run the script.
It will add what it needs to the classpath.
Avatar of Mach70803
Mach70803

ASKER

This is what I get when I run the script.

using jpcap installed at ./
using libpcap libraries from /usr/lib
using Java VM at /opt/blackdown-jdk-1.4.2.01..
INFO: loading properties from /home/adbowers/jpcap-0.01.16/./properties/tool.properties
PacketCapture: loading native library jpcap.. Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/adbowers/jpcap-0.01.16/lib/libjpcap.so: /home/adbowers/jpcap-0.01.16/lib/libjpcap.so: cannot open shared object file: No such file or directory

The libjpcap.so file exists in that directory and with all the proper permissions.  If I copy that file into all the subdirectories, I get another error.  That particular one complaint about the classpath.
This library is not working.
I had project some thing like this , I tried alot but it did'nt worked
that error is occurring because libjpcap.so is not in your LD_LIBRARY_PATH
Can you post the script?
Here is a link to the contents of the script:
http://www.cs.fsu.edu/~adbowers/jpcap.txt

I have set the LD_LIBRARY_PATH to the location of the .so file.

adbowers@hotbbq ~/jpcap-0.01.16 $ set | grep PATH
CLASSPATH=.
INFOPATH=/usr/share/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4/info:/usr/share/info/emacs-21
LD_LIBRARY_PATH=/home/adbowers/jpcap-0.01.16/lib
MANPATH=/usr/local/share/man:/usr/share/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4/man:/usr/share/man::/opt/blackdown-jdk-1.4.2.01/man
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/3.4:/usr/x86_64-pc-linux-gnu/gcc-bin/3.4:/usr/X11R6/bin:/opt/blackdown-jdk-1.4.2.01/bin:/opt/blackdown-jdk-1.4.2.01/jre/bin:/usr/games/bin

adbowers@hotbbq ~/jpcap-0.01.16 $ set | grep JAVA
JAVAC=/opt/blackdown-jdk-1.4.2.01/bin/javac
JAVA_HOME=/opt/blackdown-jdk-1.4.2.01
Can you also post the output when you try to run the script?
I did, it's in the third post.
Oh - so it hasn't changed since then?
Nope, exact same thing.  Same thing if I run as root.
> I have set the LD_LIBRARY_PATH to the location of the .so file.

which is where exactly?
All I see in LD_LIBRARY_PATH is /home/adbowers/jpcap-0.01.16/lib which typically is not where the shared library resides.
What happens when you open a new terminal and

echo $LD_LIBRARY_PATH

?
Please read the previous posts so you don't repeatedly ask question that are already answered.

Did you build the shared library you are using or is it the one provided?
>>Please read the previous posts so you don't repeatedly ask question that are already answered.

I didn't ask you. That question has NOT been answered. You also reveal by your comments you have not read (or possibly understood) the script
ROTFL
Well I figured it out.  For some reason it doesnt not like my .so because it works fine on another machine.  I suspect it has something to do with the fact that I am running it on a unstable 64-bit Gentoo machine.  I can now run the script to launch the demo.  I still don't know how to write my own programs with it, but I can put that into another post.
Good to hear, thought it must have been a problem with your box not liking the shared file.
Perhaps try rebuilding it on that machine and see if that helps.
>>I still don't know how to write my own programs with it,

The basics are really just that you need to load the library and call the methods
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial