Can JNI handle any dll files (Windows)?
Posted
by henry
on Stack Overflow
See other posts from Stack Overflow
or by henry
Published on 2010-04-15T02:26:52Z
Indexed on
2010/04/15
2:33 UTC
Read the original article
Hit count: 292
I am new to JNI. And have a few questions : Can JNI handle every type dll exists in windows? I wanted to link a library but it gives me error. Is it possible JNI and the dll are not compatible?
Excerpt from VB .NET (It works)
Private Declare Function ConnectReader Lib "rfidhid.dll" () As Integer
Private Declare Function DisconnectReader Lib "rfidhid.dll" () As Integer
Private Declare Function SetAntenna Lib "rfidhid.dll" (ByVal mode As Integer) As Integer
Full Code From Java
public class MainForm {
/**
* @param args
*/
public native int ConnectReader();
public static void main(String[] args) {
// TODO Auto-generated method stub
MainForm mf = new MainForm();
System.out.println(mf.ConnectReader());
}
static {
System.loadLibrary("rfidhid");
}
}
Error code shown
Exception in thread "main" java.lang.UnsatisfiedLinkError: MainForm.ConnectReader()I
at MainForm.ConnectReader(Native Method)
at MainForm.main(MainForm.java:13)
Can anyone point to me where I might do wrong
© Stack Overflow or respective owner