Alternative to java.lang.Runtime.exec() that can execute command lines as a single string?
问题 I am calling java.lang.Runtime.exec(...) but this seems to accept the command lines as an array and I want to use a single string. How can I do the same using a single string? 回答1: From the linked Javadocs: envp - array of strings, each element of which has environment variable settings in the format name=value , or null if the subprocess should inherit the environment of the current process. So just pass in null for the second parameter, and the environment will be inhereted. 回答2: If you