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: Mac Launcher



If you create a very simple bootstrap client with a custom ClassLoader you could do this entirely in Java and not worry about replacing the JAR at runtime. If you change your app to return control to the bootstrapper you might even be able to create the equivalent of a "reboot with new code" without ever exiting the original VM. Just destroy and re-create the application ClassLoader.

To do it you'd make a launch.jar that has a single class with a main() method that does nothing more than put up a splash screen, copy in the latest JARs, and then launches your application. If the code is minimal the response should be fairly quick. I found one heavy hit in Swing app start-up is class loading; this mechanism would postpone the loading of your app's classes until after the splash screen goes up.

You might want to take a look at the code behind the "uberjar" mechanism (the class is called Bootstrap) in ClassWorlds. It's not quite what you want but might provide some good sample code.

http://classworlds.codehaus.org/index.html

Of course if it's still not fast enough then native code may be your only choice. You might consider a portable C++ windowing framework like WxWindows in the interest of creating a launcher that's as portable as the Java code. That has overhead, though, and if you just want to support one or two platforms then straight native APIs may be better.

Finally, it's worth asking whether Java Web Start is an option. After all, it does all of the above for you and exists on all JDK 1.4 platforms.

Hope that helps.

--kd

On Apr 26, 2004, at 5:35 PM, Bryan Waters wrote:

I'm trying to build an auto-upgrade system for a java app that i built that
runs on the mac. I have the system working but the problem is replacing the
.jar file of the app itself while the app is running...also, there is a
signficant issue with launch speed, so what i want to do is build a native
app that moves the upgrade files into place (after they have already been
downloaded of course) and puts up a splash screen while doing it...

I have a shell script that is designed to do just that but i have to be able
to launch the shell script from a native app. 2 questions: first, any
comments or thoughts about how i'm going about this...second, how do i run a
mac osx shell script as a child process of another app and then launch my
java application after all that is done.

TIA
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Mac Launcher (From: "Bryan Waters" <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.