Index: trunk/src/org/openstreetmap/josm/gui/MapViewState.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapViewState.java	(revision 13180)
+++ trunk/src/org/openstreetmap/josm/gui/MapViewState.java	(revision 13181)
@@ -3,4 +3,5 @@
 
 import java.awt.Container;
+import java.awt.GraphicsEnvironment;
 import java.awt.Point;
 import java.awt.geom.AffineTransform;
@@ -145,8 +146,14 @@
 
     private static Point findTopLeftOnScreen(JComponent position) {
-        try {
-            return position.getLocationOnScreen();
-        } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) {
-            throw BugReport.intercept(e).put("position", position).put("parent", position::getParent);
+        if (GraphicsEnvironment.isHeadless()) {
+            // in our imaginary universe the window is always (10, 10) from the top left of the screen
+            Point topLeftInWindow = findTopLeftInWindow(position);
+            return new Point(topLeftInWindow.x + 10, topLeftInWindow.y + 10);
+        } else {
+            try {
+                return position.getLocationOnScreen();
+            } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) {
+                throw BugReport.intercept(e).put("position", position).put("parent", position::getParent);
+            }
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 13180)
+++ trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 13181)
@@ -3,4 +3,5 @@
 
 import java.awt.Cursor;
+import java.awt.GraphicsEnvironment;
 import java.awt.Point;
 import java.awt.Rectangle;
@@ -320,5 +321,7 @@
 
     protected boolean isVisibleOnScreen() {
-        return SwingUtilities.getWindowAncestor(this) != null && isShowing();
+        return GraphicsEnvironment.isHeadless() || (
+            SwingUtilities.getWindowAncestor(this) != null && isShowing()
+        );
     }
 
