Index: trunk/src/org/openstreetmap/josm/actions/RestartAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/RestartAction.java	(revision 5949)
+++ trunk/src/org/openstreetmap/josm/actions/RestartAction.java	(revision 5951)
@@ -37,4 +37,5 @@
         putValue("toolbar", "action/restart");
         Main.toolbar.register(this);
+        setEnabled(isRestartSupported());
     }
 
@@ -48,9 +49,18 @@
     
     /**
+     * Determines if restartting the application should be possible on this platform.
+     * @return {@code true} if the mandatory system property {@code sun.java.command} is defined, {@code false} otherwise.
+     * @since 5951
+     */
+    public static boolean isRestartSupported() {
+        return System.getProperty("sun.java.command") != null;
+    }
+    
+    /**
      * Restarts the current Java application
      * @throws IOException
      */
     public static void restartJOSM() throws IOException {
-        if (!Main.exitJosm(false)) return;
+        if (isRestartSupported() && !Main.exitJosm(false)) return;
         try {
             // java binary
@@ -108,5 +118,6 @@
                 ImageProvider.get("restart"),
                 tr("Restart the application."),
-                ht("/Action/Restart")
+                ht("/Action/Restart"),
+                isRestartSupported()
         );
     }
Index: trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 5949)
+++ trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java	(revision 5951)
@@ -33,21 +33,36 @@
 
     public static class ButtonSpec {
-        public String text;
-        public Icon icon;
-        public String tooltipText;
-        public String helpTopic;
-
+        public final String text;
+        public final Icon icon;
+        public final String tooltipText;
+        public final String helpTopic;
+        public final boolean enabled;
+       
         /**
-         *
-         * @param text  the button text
-         * @param icon  the icon to display. Can be null
-         * @param tooltipText  the tooltip text. Can be null.
+         * Constructs a new {@code ButtonSpec}.
+         * @param text the button text
+         * @param icon the icon to display. Can be null
+         * @param tooltipText the tooltip text. Can be null.
          * @param helpTopic the help topic. Can be null.
          */
         public ButtonSpec(String text, Icon icon, String tooltipText, String helpTopic) {
+            this(text, icon, tooltipText, helpTopic, true);
+        }
+
+        /**
+         * Constructs a new {@code ButtonSpec}.
+         * @param text the button text
+         * @param icon the icon to display. Can be null
+         * @param tooltipText the tooltip text. Can be null.
+         * @param helpTopic the help topic. Can be null.
+         * @param enabled the enabled status
+         * @since 5951
+         */
+        public ButtonSpec(String text, Icon icon, String tooltipText, String helpTopic, boolean enabled) {
             this.text = text;
             this.icon = icon;
             this.tooltipText = tooltipText;
             this.helpTopic = helpTopic;
+            this.enabled = enabled;
         }
     }
@@ -95,4 +110,5 @@
                 }
                 b.setFocusable(true);
+                b.setEnabled(spec.enabled);
                 buttons.add(b);
             }
