We don’t allow questions seeking recommendations for books, tool开发者_C百科s, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this questionIs there a Java library/API available to interact with Windows OS, like executing commands on the command prompt and returning the output back to the program?
You can use java.lang.Runtime.exec()
to do it, but read this first.
Use the ProcessBuilder, which is available starting from Java 1.5!
It has the nice ability to let you redirect the error stream which makes you only have to cope with one InputStream to read from.
Good article here: Runtime.exec() and the API is here: link text
精彩评论