Index: /trunk/src/org/openstreetmap/josm/actions/RestartAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/RestartAction.java	(revision 6233)
+++ /trunk/src/org/openstreetmap/josm/actions/RestartAction.java	(revision 6234)
@@ -91,9 +91,14 @@
             // program main and program arguments (be careful a sun property. might not be supported by all JVM)
             String[] mainCommand = System.getProperty("sun.java.command").split(" ");
+            // look for a .jar in all chunks to support paths with spaces (fix #9077)
+            String jarPath = mainCommand[0];
+            for (int i = 1; i < mainCommand.length && !jarPath.endsWith(".jar"); i++) {
+                jarPath += " " + mainCommand[i];
+            }
             // program main is a jar
-            if (mainCommand[0].endsWith(".jar")) {
+            if (jarPath.endsWith(".jar")) {
                 // if it's a jar, add -jar mainJar
                 cmd.add("-jar");
-                cmd.add(new File(mainCommand[0]).getPath());
+                cmd.add(new File(jarPath).getPath());
             } else {
                 // else it's a .class, add the classpath and mainClass
