Aargh! Java fall down, go boom!


I had a downright peculiar problem. Any Java app I ran on my Mac apparently painted the window in the wrong order, so that the content was overwritten by the canvas. In some cases I could drag or tab through and get to see the fields, but not reliably.

I tried logging in as another user, and it worked fine, but deleting every preference and cache file that mentioned “java” in the name didn’t help a bit. And so, the search began.

Binary search, that is, where I started by moving my entire home directory out of the way without rebooting, tested (worked!), and gradually narrowed it down. To make a long story short, it was ~/Library/Preferences/.GlobalPreferences.plist, specifically the AppleDisplayScaleFactor key, which was set to “1”. [note: use plutil to convert plist files back into the old XML format]

Why? Because long ago and far away, I once played with the under-development GUI scaling feature in Tiger. It wasn’t ready then, still isn’t ready now, and setting the value back to “1” is supposed to be the same as never having set it in the first place. One of the recent Java updates disagrees.

Nuke that pref, and instantly every Java app paints correctly.