Class PidUtil

java.lang.Object
org.zeroturnaround.process.PidUtil

public final class PidUtil extends Object
Helper methods for retrieving process IDs.
  • Constructor Details

    • PidUtil

      public PidUtil()
  • Method Details

    • getMyPid

      public static int getMyPid()
      Returns:
      process ID of the current JVM.
    • getPid

      public static int getPid(Process process)
      Detects PID from given Process object. An error is thrown if we're unable to detect the PID.
      Parameters:
      process - process object (not null).
      Returns:
      detected PID (not null).