Exception in thread "main" java.lang.UnsatisfiedLinkError: <method name>

Joined
Mar 18, 2009
Messages
3
Reaction score
0
Hi All,

I am trying to use the native method call in one of my java class to use C++ code.

I have created the dll file from the C++ and and the native method declared inside my java class is declared inside the DLL file.

I put the dll in system32 . And in my java code i have loaded the dll inside the static block .

But its throwing error when i am trying to call the native method.

Below is my code ::


package com.delfigo.jni;

/**
* @author Debapriya.Patra
*
*/
public class JNIInvocation {
// Native method declaration
public native int display();

// Load the DLL from java.path.entry
static {
System.loadLibrary("delfigo");
}

/**
* @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();
}
}
}




Can any one tell me why the error is coming when i am trying to call the native method.

ERROR :: java.lang.UnsatisfiedLinkError: <method name>


please anybody can help me out...


thnx in advance...


Regards
Debapriya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top