Trupti,
For simplicity sake lets assume that you are working in the c:\jni folder.
Here are the steps( All files are generated in the same folder)
1.Write the .java file
2.Use Javah utility to generate the .h file
3.Use notepad or vc++ editor to write the implementation, the file includes the jni.h file found in <jdk install folder>/include directory.
4.Compile using the following attributes
C:\jni>cl -Ic:\jdk1.3\include -Ic:\jdk1.3\include\win32 -LD TestImp.c -Fetest.dll.
Output is something like
C:\jni>cl -Ic:\jdk1.3\include -Ic:\jdk1.3\include\win32 -LD TestImp.c -Fetest.dll
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
TestImp.c
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/dll
/implib:test.lib
/out:test.dll
TestImp.obj
Creating library test.lib and object test.exp
5.You might see that the file test.dll or test.so(linux) is generated in the folder
6.Run your sample Class..and u must see the result.
Hope this cobbled up stuff helps...
Lemme know if you have any specific probs.
Cheers!