[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1121
  • Last Modified:

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?
0
Mach70803
Asked:
Mach70803
  • 8
  • 7
  • 5
  • +2
1 Solution
 
CEHJCommented:
Personally no. What problems are you having?
0
 
objectsCommented:
> 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.
0
 
Mach70803Author Commented:
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.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
jprgnCommented:
This library is not working.
I had project some thing like this , I tried alot but it did'nt worked
0
 
objectsCommented:
that error is occurring because libjpcap.so is not in your LD_LIBRARY_PATH
0
 
CEHJCommented:
Can you post the script?
0
 
Mach70803Author Commented:
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
0
 
CEHJCommented:
Can you also post the output when you try to run the script?
0
 
Mach70803Author Commented:
I did, it's in the third post.
0
 
CEHJCommented:
Oh - so it hasn't changed since then?
0
 
Mach70803Author Commented:
Nope, exact same thing.  Same thing if I run as root.
0
 
objectsCommented:
> I have set the LD_LIBRARY_PATH to the location of the .so file.

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

echo $LD_LIBRARY_PATH

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

0
 
objectsCommented:
Did you build the shared library you are using or is it the one provided?
0
 
CEHJCommented:
>>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
0
 
objectsCommented:
ROTFL
0
 
Mach70803Author Commented:
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.
0
 
objectsCommented:
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.
0
 
CEHJCommented:
>>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
0
 
moduloCommented:
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 8
  • 7
  • 5
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now