Hi All,

I am facing one problem on calling the native method from my java code.
Can anyone help me on this how to solve the problem.

My dll is created from C++ code and in my java class its loading properly.But when i am trying to call the native method its throwing exception::

Code:
java.lang.UnsatisfiedLinkError: display
    at com.delfigo.jni.JNIInvocation.display(Native Method)
    at com.delfigo.jni.JNIInvocation.main(JNIInvocation.java:26)

and my java class is given below where i am trying to call the native method::

Code:
public class JNIInvocation {
    // Native method declaration
    public native int display();

    // Load the DLL from java.path.entry
    static {
        System.load("D:\\delfigoSecurity\\DLL\\delfigo.dll");
    }

    /**
     * @param args
     */
    public static void main(String[] args) {
        // Call C++ method
        try {
            JNIInvocation lInvocation = new JNIInvocation();
            int lDisplay = lInvocation.display();
            System.out.println(lDisplay);
        } catch (Error e) {
            e.printStackTrace();
        }
    }
}
Its not able to find the native method declared in the dll .


Can anyone help me on this

Thanks in advance


Regards,
Debapriya

Last edited by shabbir; 31Mar2009 at 07:17.. Reason: Code blocks