Handle spaces in java arguments properly

Review/use by @huntc