[josm-dev] restart JOSM

Dieter Muecke d_mueck at me.com
Thu Dec 10 14:21:36 GMT 2009


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();
            }







More information about the josm-dev mailing list