public
class ProcessDestroy {
public static void main(String[] args) {
ProcessHandle.current().children().forEach(ProcessHandle::destroy);
}
}
will throw
Exception in thread "main" java.lang.RuntimeException: Not a directory
at java.base/java.lang.ProcessHandleImpl.getProcessPids0(Native Method)
at java.base/java.lang.ProcessHandleImpl.children(ProcessHandleImpl.java:423)
at java.base/java.lang.ProcessHandleImpl.children(ProcessHandleImpl.java:402)
at ProcessDestroy.main(ProcessDestroy.java:4)
This causes a number of the inbuilt tests to fail. For example, test/jdk/java/lang/ProcessHandle/Basic.java
The following program
will throw
This causes a number of the inbuilt tests to fail. For example,
test/jdk/java/lang/ProcessHandle/Basic.java