Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Using JNI and applet

hi All,
can anyone explain the steps involved in calling from a .dll using Java and JNI? Steps with sample code will guide better. I'm confused :confused:
rgds,
jpdbay
[195 byte] By [jpdbay] at [2007-11-11 8:29:21]
# 1 Re: Using JNI and applet
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html
aniseed at 2007-11-11 22:35:13 >
# 2 Re: Using JNI and applet
The original post is entitled "Using JNI and applet". I think you are going to find that JNI is not going to be available to you through an applet. Applets are not usually given access to the client's operating system, and JNI is all about having access to the services exposed by the client's operating system.
nspils at 2007-11-11 22:36:13 >
# 3 Re: Using JNI and applet
hi nspils,

I just wanna clarify ur statement. Did u mean that I can't access third party dll (not system dll) for eg. dll to initialize smart card reader? From my understanding, Applets can access native methods (dll) using JNI but I hv no idea how to implement that? Plz correct me if my statement is wrong n plz clarify. Thnx in advance. :)
jpdbay at 2007-11-11 22:37:17 >
# 4 Re: Using JNI and applet
I have not researched this issue sufficiently to give you an definitive answer to your question.

My post was based on the fact that one of the properties of an applet (for security reasons) is that it runs entirely within the browser window opened on the client, and has no access to the operating system running on the client. It runs in its own little virtual machine - without connection to any other process on the client. Running a .dll on the client would, therefore, be out of the question since to connect to it you would have to reach outside of the browser window and you will be relying on OS processes to gain access to the dll.

You might be able to get around that limitation with "signing" - you'll need to research this point if you really want to use a .dll.
nspils at 2007-11-11 22:38:16 >
# 5 Re: Using JNI and applet
Here's an old article on signed applets being able to access the OS through JNI:

http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html
nspils at 2007-11-11 22:39:20 >