dcsimg
call a jni function from an applet. When I call a jni funtion it shows a linker error, but it works in simple programs in java.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, January 7, 2003 04:26 AM

I am trying to do applets that use jni. This applet uses a class where defining the native functions and loading the dll. In the other class, in the constructor, an instance of the other class is created and loaded the library. All this is in a signed jar file(signed propertly). When I load the html file that contains the reference to the .jar it works fine if I don't call native functions. The problem is that when calling native functions (at runtime), the java plugin console shows Java.lang.UnsatisfiedLinkError: my native function. At first time, I thougth it could be the library. But it works when I call these functions from a simple java program.    More>>

I am trying to do applets that use jni. This applet uses a class where defining the native functions and loading the dll.


In the other class, in the constructor, an instance of the other class is created and loaded the library.


All this is in a signed jar file(signed propertly).


When I load the html file that contains the reference to the .jar it works fine if I don't call native functions.


The problem is that when calling native functions (at runtime), the java plugin console shows
Java.lang.UnsatisfiedLinkError: my native function.


At first time, I thougth it could be the library. But it works when I call these functions from a simple java program.

I have been able to do this under windows, but I am having problems under Linux.
Any idea?

   <<Less

Re: call a jni function from an applet. When I call a jni funtion it shows a linker error, but it works in simple programs in java.

Posted By:   Christopher_Schultz  
Posted On:   Tuesday, January 7, 2003 08:34 AM

I'm pretty sure that you can't use JNI from an applet, given the security restrictions. Are you using the appletviewer, or is this from a browser.



In either case, the error you are getting it unrelated to security. You need to have your library in the right place. I'm not sure where the right place would be to 'permanently' add your library to the lirary path. Probably somewhere in $JAVA_HOME/jre/lib. Your browser setting may be different, especially if you are using a plug-in or a JRE that came with the browser.



Good luck,

-chris
About | Sitemap | Contact