开发者

Java library/API to help run windows commands [closed]

开发者 https://www.devze.com 2023-01-01 18:10 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

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 question

Is 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

0

精彩评论

暂无评论...
验证码 换一张
取 消