Handle Java paths with spaces in them (#1534)