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)



> but if for some reason you want to do that you probably have to create
> your own class loader
>

I messed around with somewhat similar ideas as part of my appedit stuff. I
think it would manage this in a somewhat crossplatform and not require a
class loader. Instead a simple self-extracting jar installer and a little
stub launcher.
You package your application by running the AppInstaller class against it
passing it the application bundle path. It creates a jar by recursing the
application bundle directory adding each file, it includes the found file
paths a vector field included in inself. Then it serializes itself including
the file paths vector as a blueprint for extracting the files from the
install jar. When the jar is double clicked or -jar executed it deserializes
the AppInstaller class, gets the list of files and extracts them. Then all
you need is some code to make the application bundle directory structure
sort of classplatform. To do this I put the application specific java
information into the Info.plist file. The application bundle of course
should run fine on OS X. On another platform you include a script, .bat or
shell script launcher that runs the application's stub launcher. That
includes a small XML parser that reads the Info.plist and determines the
actual application main class to launch and any other application specific
properties you care to include and turns around and launches your real code,
sort of a java application stub crossplatform proxy.
So simple crossplatform install and launch.
Of course there are multitudinous major players and existing standard
processes for doing these things already as Dmitry mentions. For other
reasons as well my crossplatform interests have waned somewhat so I haven't
put a lot of time into this lately but some of whats in my appedit stuff
might be along the lines of what you're talking about maybe close to proof
of concept.

Mike Hall      mikehall at spacestar dot net
http://www.spacestar.net/users/mikehall

 _______________________________________________
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.