How to get a list of current open windows/process with Java?

后端 未结 14 1563
抹茶落季
抹茶落季 2020-11-22 05:20

Does any one know how do I get the current open windows or process of a local machine using Java?

What I\'m trying to do is: list the current open task, windows or

14条回答
  •  不要未来只要你来
    2020-11-22 05:32

    Using code to parse ps aux for linux and tasklist for windows are your best options, until something more general comes along.

    For windows, you can reference: http://www.rgagnon.com/javadetails/java-0593.html

    Linux can pipe the results of ps aux through grep too, which would make processing/searching quick and easy. I'm sure you can find something similar for windows too.

提交回复
热议问题