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.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.