Java – load using applet DLL and use it on the client

I can load from the server to the client in the applet, and then call the load on the client DLL (using JNI)?

Solution

of course. The applet needs to be digitally signed by the developer and trusted by the end user (they click OK when prompted) Place the native in the root directory of the jar and add it to the runtime classpath of the applet using the reference in the archive attribute

The disadvantage of the traditional method of using the archive attribute to deploy the native to the applet is that each client obtains the native of windows, OS X and * Nix They actually need three times as many local people as they do

Recently (Java plug-in 2, introduced in sun's version 1.6.0_10), the capability is to start the embedded applet using Java Web start, and then allow us to split the local download for users Each operating system will only get the required native

It is specified in the resources section

For example From docs

<resources os="SunOS" arch="sparc">
  <nativelib href="lib/solaris/corelibs.jar"/>
</resources>

All JWs clients will download any resource part without OS or arch attribute, and the rest will only be downloaded by the matching resource part

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>