Changeset 5967 in josm for trunk


Ignore:
Timestamp:
2013-05-23T00:38:59+02:00 (7 years ago)
Author:
Don-vip
Message:

see #8720, see #8733 - More checks and some debug info in RestartAction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/RestartAction.java

    r5951 r5967  
    1818import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
    1919import org.openstreetmap.josm.tools.ImageProvider;
     20import org.openstreetmap.josm.tools.PlatformHookWindows;
    2021import org.openstreetmap.josm.tools.Shortcut;
    2122
     
    4950   
    5051    /**
    51      * Determines if restartting the application should be possible on this platform.
     52     * Determines if restarting the application should be possible on this platform.
    5253     * @return {@code true} if the mandatory system property {@code sun.java.command} is defined, {@code false} otherwise.
    5354     * @since 5951
     
    6566        try {
    6667            // java binary
    67             final List<String> cmd = new ArrayList<String>(Collections.singleton(System.getProperty("java.home") + "/bin/java"));
     68            final String java = System.getProperty("java.home") + File.separator + "bin" + File.separator +
     69                    (Main.platform instanceof PlatformHookWindows ? "java.exe" : "java");
     70            if (!new File(java).isFile()) {
     71                throw new IOException("Unable to find suitable java runtime at "+java);
     72            }
     73            final List<String> cmd = new ArrayList<String>(Collections.singleton(java));
    6874            // vm arguments
    6975            for (String arg : ManagementFactory.getRuntimeMXBean().getInputArguments()) {
     
    8995            // finally add program arguments
    9096            cmd.addAll(Arrays.asList(Main.commandLineArgs));
     97            Main.info("Restart "+cmd);
    9198            // execute the command in a shutdown hook, to be sure that all the
    9299            // resources have been disposed before restarting the application
Note: See TracChangeset for help on using the changeset viewer.