long pid = ProcessHandle.current().pid();
References
https://stackoverflow.com/questions/35842/how-can-a-java-program-get-its-own-process-id
long pid = ProcessHandle.current().pid();
References
https://stackoverflow.com/questions/35842/how-can-a-java-program-get-its-own-process-id