Java plugin (JAI) automatic installation

99封情书 提交于 2019-12-11 09:15:41

问题


I was wondering if anyone has any experience getting JAI to auto install from an applet for multiple platforms. I've looked at

http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/extensions.html#specifying

And it seems to imply (by the fact nothing to the contrary is mentioned) I can only specify an single platforms installer. e.g.

Extension-List: jai_core
jai_core-Extension-Name: javax.media.jai
jai_core-Specification-Version: 1.1-mr
jai_core-Implementation-Version: 1.1.3
jai_core-Implementation-Vendor-Id: com.sun
jai_core-Implementation-URL: http://mydomain.com/jai-windows.jar

I can't see anyway of specifying an implementation url based on platform and JAI has a lot of native stuff so it looks like I have to choose a single platform. I must be missing something obvious as this defeats the initial major objective of Java :-(

The only solutions I can think is to either specify an url to something that can hopefully determine what the target platform is and send back the relevant file, create multiple applet jars, each with different manifests. This is far from ideal.


回答1:


Just use the $(os-name)$ construct as mentioned in the documentation

Optional Package Versioning: Download and Installation of Optional Packages

jai_core-Implementation-URL: http://mydomain.com/jai-$(os-name)$.jar

Where $(os-name)$ holds the name of the target operating system as defined by the os.name system property.



来源:https://stackoverflow.com/questions/1707715/java-plugin-jai-automatic-installation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!