Re: JAR file which needs to call another jar file....



James Westby wrote:
Thomas Hawtin wrote:

You can open the jar inside as a resource, but you wouldn't be able to load classes from it (as an applet).

Thanks for pointing this out. Could you clarify the comment "as an applet" for me please? Do you Mean that an applet could not be created from them, or that they cannot be loaded when you are operating as an applet? If it is the latter then how is it possible as an application? Does it require a different classloader to be used?

Yeah. Copy the data out of the resource and create a custom ClassLoader that uses that data.


Applets cannot create class-loaders (unless they are signed). However, they can read the data fine.

Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
.



Relevant Pages

  • Re: applet codebase, archive and forName
    ... I think the problem is that unsigned applets are not allowed to load classes ... from any codebase other than the one from which the applet itself was loaded. ... You could try messing with a signed applet, but I don't understand why you need ... to use a separate classloader in the first place. ...
    (comp.lang.java.programmer)
  • Re: java deferred GUI painting considered harmful to sanity
    ... application (or applet). ... Tom Hawtin ... Unemployed English Java programmer ...
    (comp.lang.java.advocacy)