Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 19010)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 19012)
@@ -55,4 +55,5 @@
 import javax.swing.InputMap;
 import javax.swing.JComponent;
+import javax.swing.JDialog;
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
@@ -184,4 +185,8 @@
      */
     private static volatile List<String> commandLineArgs;
+    /**
+     * The preference key for the startup failure counter
+     */
+    private static final String PREF_STARTUP_FAILURE_COUNTER = "josm.startup.failure.count";
 
     /**
@@ -878,4 +883,22 @@
         checkIPv6();
 
+        // After IPv6 check since that may restart JOSM, must be after Preferences.main().init()
+        final int failures = prefs.getInt(PREF_STARTUP_FAILURE_COUNTER, 0);
+        // Always increment failures
+        prefs.putInt(PREF_STARTUP_FAILURE_COUNTER, failures + 1);
+        if (failures > 3) {
+            final int selection = JOptionPane.showOptionDialog(new JDialog(),
+                    tr("JOSM has failed to start up {0} times. Reset JOSM?", failures),
+                    tr("Reset JOSM?"),
+                    JOptionPane.YES_NO_OPTION,
+                    JOptionPane.ERROR_MESSAGE,
+                    null,
+                    null,
+                    null);
+            if (selection == JOptionPane.YES_OPTION) {
+                Preferences.main().init(true);
+            }
+        }
+
         processOffline(args);
 
@@ -1010,4 +1033,5 @@
             }
             mainFrame.setVisible(true);
+            Config.getPref().put(PREF_STARTUP_FAILURE_COUNTER, null);
         });
 
