Listing processes

Prior to Java 9, we did not have the means to obtain a list of active processes. With Java 9 it is now possible to get the processes in a stream. There are three methods that return a Stream<ProcessHandle>. One lists the child processes. The other lists all the descendants; the children and the children of those recursively. The third lists all the processes.

Get Java 9: Building Robust Modular Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.