Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get all the current process and print out id of each
package com.knoldus;
public class CurrentAllProcess {
public static void main(String[] args) throws Exception {
final Stream<ProcessHandle> currentProcesses = ProcessHandle.allProcesses();
currentProcesses.filter(ProcessHandle::isAlive).forEach(processHandle ->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment