Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT .jar question (was java -jar versus java -cp)




On Dec 30, 2004, at 8:41 PM, Dmitry Markman wrote:

if I understand right you want to store
third party jar file in your jar file as jar file

I'd never do that
(ant and CodeWarrior, XCode allow you to merge any jar file into your product jar file)


but if for some reason you want to do that you probably have to create your own class loader
to load classes from that jar_in_jar combination


Here's a classloader that does just that:

http://www.jpevans.com/software/jjcl/

If you ask me this really should be a feature of the standard classloader, so long as the Manifest of the outer JAR mentioned the JARs it contained so as to keep the performance acceptable. This would integrate nicely with the jar -i indexing feature.

Of course, if anyone at sun had had half a brain, they would have required runnable JARs be named with a different extension [*] (eg, Foo.jarx) so we could train users which ones they can double click. Further the operating system (whatever it might be) would be able to visually distinguish runnable jars, giving them an application icon, and we wouldn't have the awfully common case where a user double clicks on some library jar only to be told it's not runnable due to a missing main class. (Which is wrong, its not runnable because it's a library, not an application, but the OS has no way to know this).

[*] ok, so filename extensions suck, but we're talking cross platform here, so its all we've got

AndyT (lordpixel - the cat who walks through walls)
A little bigger on the inside

        (see you later space cowboy ...)

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: java -jar versus java -cp (From: Craig Mattocks <email@hidden>)
 >OT .jar question (was java -jar versus java -cp) (From: Morgan Schweers <email@hidden>)
 >Re: OT .jar question (was java -jar versus java -cp) (From: Dmitry Markman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.