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?
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.
nothing, just run the script.
It will add what it needs to the classpath.
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.0 1..
INFO: loading properties from /home/adbowers/jpcap-0.01. 16/./prope rties/tool .propertie s
PacketCapture: loading native library jpcap.. Exception in thread "main" java.lang.UnsatisfiedLinkE rror: /home/adbowers/jpcap-0.01. 16/lib/lib jpcap.so: /home/adbowers/jpcap-0.01. 16/lib/lib jpcap.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.
using jpcap installed at ./
using libpcap libraries from /usr/lib
using Java VM at /opt/blackdown-jdk-1.4.2.0
INFO: loading properties from /home/adbowers/jpcap-0.01.
PacketCapture: loading native library jpcap.. Exception in thread "main" java.lang.UnsatisfiedLinkE
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
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?
ASKER
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/x 86_64-pc-l inux-gnu/3 .4/info:/u sr/share/g cc-data/x8 6_64-pc-li nux-gnu/3. 4/info:/us r/share/in fo/emacs-2 1
LD_LIBRARY_PATH=/home/adbo wers/jpcap -0.01.16/l ib
MANPATH=/usr/local/share/m an:/usr/sh are/man:/u sr/share/g cc-data/x8 6_64-pc-li nux-gnu/3. 4/man:/usr /share/gcc -data/x86_ 64-pc-linu x-gnu/3.4/ man:/usr/s hare/man:: /opt/black down-jdk-1 .4.2.01/ma n
PATH=/usr/local/sbin:/usr/ local/bin: /usr/bin:/ usr/sbin:/ sbin:/bin: /opt/bin:/ usr/x86_64 -pc-linux- gnu/gcc-bi n/3.4:/usr /x86_64-pc -linux-gnu /gcc-bin/3 .4:/usr/X1 1R6/bin:/o pt/blackdo wn-jdk-1.4 .2.01/bin: /opt/black down-jdk-1 .4.2.01/jr e/bin:/usr /games/bin
adbowers@hotbbq ~/jpcap-0.01.16 $ set | grep JAVA
JAVAC=/opt/blackdown-jdk-1 .4.2.01/bi n/javac
JAVA_HOME=/opt/blackdown-j dk-1.4.2.0 1
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:/
LD_LIBRARY_PATH=/home/adbo
MANPATH=/usr/local/share/m
PATH=/usr/local/sbin:/usr/
adbowers@hotbbq ~/jpcap-0.01.16 $ set | grep JAVA
JAVAC=/opt/blackdown-jdk-1
JAVA_HOME=/opt/blackdown-j
Can you also post the output when you try to run the script?
ASKER
I did, it's in the third post.
Oh - so it hasn't changed since then?
ASKER
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?
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
?
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
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
ASKER
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.
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
The basics are really just that you need to load the library and call the methods
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.