views:

164

answers:

2

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 !

A: 

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?)

Tom Hawtin - tackline
In my case, yes. I have quite a big applet, with a lot of dependencies, whose list is generated by maven. If I could avoid duplicating the information (having the jar list in the class path AND in the HTML...), I would be happy. I'll test the JNLP solution.
Laurent K
A: 

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?

Knife-Action-Jesus