Hi All,
I am newbie to JNI API. I am trying to do a HelloWorld program using it. I have written a
Java program (Test.java) containing a native method. The native method is implemented in 'C'(Test.c) to print a
string. On these files
1. I compiled Test.java. - javac
2. Generated a header file. - javah
3. Taken the method signature form Test.h an put it into Test.c
4. Using cl command generated a test.dll file
5. Tried to run it using java
Test but getting the following error
Exception in
thread "main" java.lang.UnsatisfiedLinkError: D:\JNITest\test.dll:
Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at Test.<clinit>(Test.java:7)
All of my files are in a single folder.
Will be waiting for your replies...
Thanks in advance
Regards,
Omkar V S