Run sample java program on jpcap in linux
here is the errors when i tried to run them
[root@localhost sample]# javac SendICMP.java [root@localhost sample]# java SendICMP Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.6.0_16/jre/lib/i386/libjpcap.so: /usr/java/jdk1.6.0_16/jre/lib/i386/libjpcap.so: undefined symbol: pcap_sendpacket at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1695) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at jpcap.JpcapCaptor.<clinit>(JpcapCaptor.java:251) at SendICMP.main(SendICMP.java:11) [root@localhost sample]# please reply this. Thank you |
Quote:
Code:
# yum install jpcap |
Quote:
John G |
libpcap.so is present in /usr/lib but it still gives the error
it seems me that it cannot find where's libpcap.so is? Or is there something to do with pcp_sendpacket? I've already set the variables correctly in /etc/profile as required please help ..:( |
Quote:
I don't know if this'll help, but to make sure that's not the problem, you can: Code:
export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH John G |
[root@localhost sample]# java SendICMP
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.6.0_16/jre/lib/i386/libjpcap.so: /usr/java/jdk1.6.0_16/jre/lib/i386/libjpcap.so: undefined symbol: pcap_sendpacket at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1695) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at jpcap.JpcapCaptor.<clinit>(JpcapCaptor.java:251) at SendICMP.main(SendICMP.java:11) it still gives the error i added libjpcap.so to /usr/lib /usr/java/jdk1.6.0_16/jre/lib/i386/libjpcap.so /usr/java/packages/lib/ext error detects LD_LIBRARY_PATH which i set to /usr/java/jdk1.6.0_16/jre/lib/i386/libjpcap.so question is it doesn't know about pcp_sendpacket " undefined symbol: pcap_sendpacket " since lipcap 0.8.3 version doesn't support send packet option i've downloaded libpcap 0.9.7 and did ./configure make make install but it didn't replace /usr/lib following files libpcap.a libpcap.so.0 libpcap.so.0.8 libpcap.so.0.8.3 which is of old libpcap version may be that's why libjpcap.so is giving errors thanx for your help... but im still stuck ... :( |
All times are GMT -5. The time now is 02:28 AM. |