2018-10-19

Java 9 : Process API updates

Java's Process API has been quite primitive, with support only to launch new
processes, redirect the processes' output, and error streams. In this release, the
updates to the Process API enable the following:

Get the PID of the current JVM process and any other processes spawned by the
JVM
Enumerate the processes running in the system to get information such as PID,
name, and resource usage
Managing process trees
Managing sub processes

Let's look at a sample code, which prints the current PID as well as the current
process information:

//NewFeatures.java
public class NewFeatures{
public static void main(String [] args) {
ProcessHandle currentProcess = ProcessHandle.current();
System.out.println("PID: " + currentProcess.getPid());
ProcessHandle.Info currentProcessInfo = currentProcess.info();
System.out.println("Info: " + currentProcessInfo);
}
}


1 comment:

  1. Well you can easily buy IPv6 proxies for Facebook as they are cheaper then IPv4 proxies and start your Facebook automation today.

    Facebook Proxies
    http://www.ipvsix.site/

    ReplyDelete