The strange thing is I never told eclipse where to find the DLL (it
just automatically found it WINDOWS), so I can't figure out why the
command line java is not finding it.....
Any ideas?
Thanks,
cpp
Post the full text of the exception.
I'll assume that C:\WINDOWS is in your PATH...
/gordon
--
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
>Post the full text of the exception.
Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: open
at net.sourceforge.jpcap.capture.PacketCapture.open(Native
Method)
at
net.sourceforge.jpcap.capture.PacketCapture.open(PacketCapture.java:6
3)
at network.Sniffer.startSniff(Sniffer.java:132)
at network.Sniffer.run(Sniffer.java:170)
at java.lang.Thread.run(Unknown Source)
>I'll assume that C:\WINDOWS is in your PATH...
Yes, it is.
From the error message it is clear that the DLL was found and
successfully loaded. The error is that it does not appear to contain
the expected method "open".
Have you compiled the DLL or did it come pre-compiled with jpcap?
Use a tool like dumpbin, depends or quickview to display the actual
contents of the DLL. Confirm that it does contain the method, and that
the symbol name has not been mangled by the compiler.
Do you have different versions of the jpcap library installed on your
system?
I see. But everything is working fine from eclipse... which means
that 2 different DLLs must be getting read, right? Or is there
another explanation?
I verified that C:\WINDOWS is the first folder on my path that
contains a file called "jpcap.dll".
>Do you have different versions of the jpcap library installed on your
>system?
This is possible, and seems the most likely explanation. So how can I
figure out what DLL eclipse is loading, since that is obviously the
correct one?
Thanks for your help,
cpp
The loadLibrary function look in the home directory, in the java
-Djava.library.path variable and in the path.
I have an old version of the DLL in java.library.path.
DOH!
Thanks for your help Gordon.