![]() |
JNI PROBELM :: Error in calling the native method
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: displayand my java class is given below where i am trying to call the native method:: Code:
public class JNIInvocation {Can anyone help me on this Thanks in advance Regards, Debapriya |
Re: JNI PROBELM :: Error in calling the native method
You have defined wrong PATH. To load your library write:
Code:
|
Re: JNI PROBELM :: Error in calling the native method
No because i have tried with that option also its throwing same error.
|
Re: JNI PROBELM :: Error in calling the native method
from your point of view what is the right way ?? can u tell the solution i mean that option.
|
Re: JNI PROBELM :: Error in calling the native method
In my code I use:
Code:
|
Re: JNI PROBELM :: Error in calling the native method
Hi,
I have changed the way you told to load the dll but its throwing me the same error. Do you have any idea for this error. Can you tell me the procedure whatever you did to call the C++ function inside java class. So that i can follow the steps and do the same. IS it a problem in my dll export which i declared for the native method ??? Anyway thanks for the reply once again Regards Debapriya |
Re: JNI PROBELM :: Error in calling the native method
Hi,
I wrote in Java code my own function to load a library module, the path should start with "/". In some class that is loaded the first I added items: Code:
static Hashtable<String, String> charMaps = new Hashtable<String, String>();Code:
static{Code:
public static void loadLibrary(String libName) {- path of the class where these module added; - my property "my.natives.libpath" initialized on start. If your problem persists then check the library module function signatures exprorted, in Windows they should start with underscore. |
Re: JNI PROBELM :: Error in calling the native method
BTW,
in this code I get the path of the class Code:
CNativeLibrary.class |
| All times are GMT +5.5. The time now is 09:58. |