Is it possible to declare an applet's classpath into the JAR and not into the applet tag?
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 t开发者_StackOverflowhere a way to achieve this ?
Did I miss something, somewhere ?
Thank you for your help !
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?)
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?
精彩评论