是否可以将 applet 的类路径声明到 JAR 中而不是声明到 applet 标记中?
我正在构建一个具有相当大的类路径的小程序。 (externalLib1.jar、externalLib2.jar
等)
MyApplet.jar
,小程序的 jar 包含一个 Manifest.MF,其中包含列出所有必需 jar 的 ClassPath 属性。
ClassPath = externalLib1.jar externalLib2.jar externalLib3.jar externalLib4.jar etc.jar
有没有办法加载小程序而不列出
我想要:
<applet code="MyApplet.class" codebase="mycodeBase" archive="MyApplet.jar"/>
而不是:
<applet code="MyApplet.class" codebase="mycodeBase" archive="MyApplet.jar,externalLib1.jar,externalLib2.jar,externalLib3.jar,externalLib4.jar,etc.jar"/>
有办法实现这一点吗?
我是否错过了什么?
感谢您的帮助 !
I'm building an applet with a quite big classpath. (externalLib1.jar, externalLib2.jar
, etc.)
MyApplet.jar
, the applet's jar contains a Manifest.MF including a ClassPath attribute listing all the required jars.
ClassPath = externalLib1.jar externalLib2.jar externalLib3.jar externalLib4.jar etc.jar
Is there a way to load the applet without listing all the jars in the <applet>
tag ?
I would like to have :
<applet code="MyApplet.class" codebase="mycodeBase" archive="MyApplet.jar"/>
and not :
<applet code="MyApplet.class" codebase="mycodeBase" archive="MyApplet.jar,externalLib1.jar,externalLib2.jar,externalLib3.jar,externalLib4.jar,etc.jar"/>
Is there a way to achieve this ?
Did I miss something, somewhere ?
Thank you for your help !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 JNLP 小程序似乎是显而易见的举动,尽管它确实需要新插件。
(在 HTML 中列出 jar 是否有一个特殊的问题?)
Using JNLP applets would seem the obvious move, although it does require the new plugin.
(Is there a particular problem with listing the jars in the HTML?)
您可以从外部库中解压缩所有外部二进制类。然后将所有类与您的自定义类一起压缩到一个 jar 中。这将允许您只有一个 jar 声明,但您必须修改代码和代码库属性以确保正确导航 jar 结构。
这并不理想,但可行。如果您对 jar 进行签名,您还可以为外部库提供担保。
您对拥有一个大的类路径有什么担忧?它是否在某个地方给您带来了问题?
You can unzip all the external binary classes from the external libraries. Then zip all of the classes along with your custom ones into a single jar. This will allow you to only have one jar declaration but you will have to modify your code and codebase attributes to ensure the jar structure is navigated properly.
This isn't ideal but would work. You would also be vouching for the external libraries if your signing your jar.
What is your concern with having a large classpath? Is it causing issues for you somewhere?