> A jar cannot access a jar within itself. I'm not sure how it works in
> applets, but in applications the second jar (physics.jar) needs to be
> outside the first (PinballGame.jar), but on it's classpath.

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
>> A jar cannot access a jar within itself. I'm not sure how it works in
>> applets, but in applications the second jar (physics.jar) needs to be
>> outside the first (PinballGame.jar), but on it's classpath.
>
> 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?
I ask because I have come across this situation before (with an
application) and I couldn't see a solution to the problem that I liked
anywhere, it would be good to know whether this is possible.
Thanks,
James
Thomas Hawtin - 30 Jan 2006 00:32 GMT
>> You can open the jar inside as a resource, but you wouldn't be able to
>> load classes from it (as an applet).
[quoted text clipped - 4 lines]
> 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

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
James Westby - 30 Jan 2006 10:07 GMT
>>> You can open the jar inside as a resource, but you wouldn't be able
>>> to load classes from it (as an applet).
[quoted text clipped - 12 lines]
>
> Tom Hawtin
Thanks,
James