Reading open processes / list of applications in Java?

I was wondering if there is any Java system class or something that can read open running processes or at least talk about running applications in the OS.

As in the Windows platform, to view the list we have CTRL + Alt + DEL . Can we get this information in a java program?

+4
source share
2 answers

No.

Since Java is an agnostic of the OS, and not every operating system processes the list the same way, you must run a command line program, for example ps for * nix or tasklist for Windows (after you have determined re run on, of course), which will list everything processes and then analyze them.

+4
source

As pointed out by darioo, this cannot be done only in Java, but it can certainly be done by combining Java with other languages, such as C, in one of many ways, including using JNI, JNA, or even reading a single program output stream in Java over a socket.

+2
source

Source: https://habr.com/ru/post/1332908/


All Articles