[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

RE: JNI in Linux



     Hi Akshat,

     I haven't used the JNI (in Linux) 'cause, I am using Chapman Java <
1.1.x. But you can create a stub for the crypt()
     function, you must be knowing how (static{ .... }) compile the class
using javah (to get foo.h) and javah -stubs (to get
     foo.c). You have to call the crypt() function from the .c file. I think
it is using /lib/libc.so. Use the functions
     dlopen() to get the handle of the function (If you are familiar with
Windows programming this is similar to LoadLibrary()
     call or LoadLibraryEx() call or ...). To get the address of the
function use dlsym() call. You can always check the manuals
     (man -a dlopen ;-)). Oh, and you get a free code for loading the cos()
library in the manuals !! I just found that out. Even
     better than the documentations. The same should apply for JNI calls.
Try to use gdb. I think that is damn useful tool. I
     myself got out of a stiff corner by using gdb.

     Happy Linuxing,

     Suvendra

> -----Original Message-----
> From:	Aranya [SMTP:akshata@xxxxxxxxxxxxxxxxxxx]
> Sent:	Saturday, July 24, 1999 10:43 AM
> To:	linux-india@xxxxxxxxx
> Subject:	JNI in Linux
> 
> Hi,
> 
> Can anybody help me with JNI programming in Linux. I have to simply access
> the crypt() function from Java. My code's giving me a SIGSEGV and core
> dump.
> 
> Akshat
> 
> 
> --------------------------------------------------------------------
> For more information on Linux in India visit http://www.linux-india.org/
> The Linux India mailing list does not accept postings in HTML format.

- --------------------------------------------------------------------
For more information on Linux in India visit http://www.linux-india.org/
The Linux India mailing list does not accept postings in HTML format.

------------------------------