This seems like a common pattern - is it worth abstracting it out? Or can we use `sys.platform` instead - we use that interchangeably with `os.name`, so if that actually tells us about the underlying platform on Jython, maybe we should be using sys.platform more.

(Aside: why is `os.name` set to 'java'? Surely `os.name` ought to be the name of the OS?)