- 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
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