Is there an alternative to Runtime.getRuntime().exec()
问题 Just wondering, if there is something better, newer, safer, faster, etc than Runtime.getRuntime().exec() . I want to run another process from my application on linux, and this is the only way i know how. Would be nice to have an alternative. 回答1: How about ProcessBuilder? A bit more: Introduced in Java 1.5, allows you to gain more control on the process environment - set the working directory, let you redirect the error stream to the input stream (from java POV) and a few more things. From