Re: [josm-dev] restart JOSM
Kirill Bestoujev wrote: Hi! How do you think a shell script will work in Windows??? Well, the windows world has their proprietary BAT files, so a shell script could be ported. Would be nice if Microsoft would join us in the third millennium and drop their VMS-based OS offerings in favor of something the real world has used in the last 40 years... ___ josm-dev mailing list josm-dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/josm-dev
Re: [josm-dev] restart JOSM
On this note, has anyone here played Puzzle Pirates? I mention this because the game is written in Java, and has an online update capability. You down load a Java loader application (small) that fetches the latest version of the code from the server. When the upload is complete it runs the game code, and terminates. The user runs the game code from then on. The first thing the game does is check for the latest version. If it is not up to date, it runs the loader application, and terminates. The loader updates the game (via diff) and launches the game once download is complete. Its a simple model, and one that I believe JOSM could benefit from emulating. Just my 2p. :-) On Thursday 10 Dec 2009 14:43:16 Ævar Arnfjörð Bjarmason wrote: On Thu, Dec 10, 2009 at 14:21, Dieter Muecke d_mu...@me.com wrote: Instead of restarting JOSM by hand after plugin update the code snippet below does it programmatically. It works on Mac OSX but before I submit a patch I would like know how do the same on Windows and Linux. Kind Regards, Dieter try { File file = File.createTempFile(josm-restart-, .sh); PrintWriter pw = new PrintWriter(new FileWriter(file)); pw.println(sleep 1); pw.println(open -a JOSM.app); pw.close(); Runtime.getRuntime().exec(/bin/sh + file.getAbsolutePath()); System.exit(0); } catch (IOException e) { e.printStackTrace(); } Why are you writing a josm-restart.sh instead of just calling /bin/sh with sleep 1 open -a JOSM.app? But no, this wouldn't work on Linux. open(1) is a Mac OS X-specific application, the usual way to do this on Linux is to look at your argv[0] and start that with your argv[1..*] arguments. However with Java programs that wouldn't work since you need to worry about calling the right JVM and using the arguments to the JVM that were used to start the current program. I'm not familiar enough with the JVM but doesn't it support reloading itself with the current environment/arguments and the currently loaded .jar? Then this could probably be implemented portably. There's also probably prior art on this, check out http://google.com/codesearch ___ josm-dev mailing list josm-dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/josm-dev ___ josm-dev mailing list josm-dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/josm-dev
Re: [josm-dev] restart JOSM
On Thu, 10 Dec 2009, Dieter Muecke wrote: Instead of restarting JOSM by hand after plugin update the code snippet below does it programmatically. It works on Mac OSX but before I submit a patch I would like know how do the same on Windows and Linux. Why do you want restarting JOSM after plugin update? The plugin update on startup is done before loading the plugins, so already the new plugins are loaded. And in any other case programmatically restarting is a bad idea as well (webstart, applet, security issues, ...). Ciao -- http://www.dstoecker.eu/ (PGP key available) ___ josm-dev mailing list josm-dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/josm-dev
Re: [josm-dev] restart JOSM
Dirk Stöcker openstreet...@dstoecker.de writes: On Thu, 10 Dec 2009, Dieter Muecke wrote: Instead of restarting JOSM by hand after plugin update the code snippet below does it programmatically. It works on Mac OSX but before I submit a patch I would like know how do the same on Windows and Linux. Why do you want restarting JOSM after plugin update? The plugin update on startup is done before loading the plugins, so already the new plugins are loaded. And in any other case programmatically restarting is a bad idea as well (webstart, applet, security issues, ...). Plus, unless the current state (loaded data, zoom etc.) survives the restart the benefit for the user is negligible. In my view that's not worth jumping through hoops to make it work on all platforms. Better would be if there was a way to reload plugins without having to restart JOSM. Matthias ___ josm-dev mailing list josm-dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/josm-dev
Re: [josm-dev] restart JOSM
On 10 Dec 2009, at 15:41, Matthias Julius wrote: Dirk Stöcker openstreet...@dstoecker.de writes: On Thu, 10 Dec 2009, Dieter Muecke wrote: Instead of restarting JOSM by hand after plugin update the code snippet below does it programmatically. It works on Mac OSX but before I submit a patch I would like know how do the same on Windows and Linux. Why do you want restarting JOSM after plugin update? The plugin update on startup is done before loading the plugins, so already the new plugins are loaded. And in any other case programmatically restarting is a bad idea as well (webstart, applet, security issues, ...). Plus, unless the current state (loaded data, zoom etc.) survives the restart the benefit for the user is negligible. In my view that's not worth jumping through hoops to make it work on all platforms. Better would be if there was a way to reload plugins without having to restart JOSM. +1 jEdit (a Java text editor) has a way to load, unload and reload plugins without the need to restart, and all plugins were updated a few years back for that new capability. Shaun ___ josm-dev mailing list josm-dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/josm-dev