I am using Netutil class in my simple java app to show all network interfaces, the program code is as follow and the exception result after that. I am absolute beginer and your help is big time saver for me :)
package packet_experience;
import edu.huji.cs.netutils.NetUtilsException;
import edu.huji.cs.netutils.capture.*;
import java.io.IOException;
/**
*
* @author Pete
*/
public class Packet_Experience {
/**
* @param args the command line arguments
* @throws edu.huji.cs.netutils.NetUtilsException
* @throws java.io.IOException
*/
public static void main(String[] args) throws NetUtilsException, IOException {
JPCapInterface intArr[] = JPCap.getAllIntefacesNames();
for (JPCapInterface next : intArr)
{
System.out.println(next.toString());
}
}
run:
Exception in thread "main" java.lang.UnsatisfiedLinkError: edu.huji.cs.netutils.capture.impl.JPCapWraper.get_all_devices(Z)Ljava/lang/String;
at edu.huji.cs.netutils.capture.impl.JPCapWraper.get_all_devices(Native Method)
at edu.huji.cs.netutils.capture.impl.JPCapWraper.getAllInterfaces(JPCapWraper.java:299)
at edu.huji.cs.netutils.capture.JPCap.getAllIntefacesNames(JPCap.java:346)
at packet_experience.Packet_Experience.main(Packet_Experience.java:29)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
Update (Solution!):
My CPU is CORE i5 and having Win 7 Home Pre 64bit. I tried JVM 32 and 64bit and changed System_PATH and java.library.path and copied all jar, dll, lib,... files there as well. Also I followed and performed recommendation I received on this page and I read in any other place ( as far as I could understand :) ).
At end I encountered with jnetpcap which has similar performance and I recommend it instead as works perfectly for me. You can find it at jnetpcap Homepage . Note that the same as Netutils you should adjust System_PATH and java.library.path and make sure you use JVM 32bit, otherwise you will definitely receive UnsatisfiedLinkError
.
Have fun!