How to pass values containing spaces using Runtime.exec(command)? There doesn't seem to be any way to include a space character within an argument.

Nathan Meyers

Use the Runtime.exec(String[]) call, with each argument in its own element of the string array. This is what Java does, under the covers, after separating the arguments to Runtime.exec(String) by scanning for spaces.