The hybrid solution isn't perfect for Java. The only other solution is just to always call TerminateProcess on all the child processes. Then there is no output.
You still get the following output:
2019-11-29 21:53:19
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.231-b11 mixed mode):
"Service Thread" #10 daemon prio=9 os_prio=0 tid=0x0000000019e2c800 nid=0xb40 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C1 CompilerThread3" #9 daemon prio=9 os_prio=2 tid=0x0000000019d9f800 nid=0x6bc waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread2" #8 daemon prio=9 os_prio=2 tid=0x0000000019d93800 nid=0xa30 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread1" #7 daemon prio=9 os_prio=2 tid=0x0000000019d8d800 nid=0x2778 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" #6 daemon prio=9 os_prio=2 tid=0x0000000019d87000 nid=0x246c waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x0000000019d85800 nid=0x1f4c runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x0000000019d84000 nid=0xf1c waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" #3 daemon prio=8 os_prio=1 tid=0x0000000002e8d800 nid=0x29dc in Object.wait() [0x000000001a24f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000d5a08ed8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x00000000d5a08ed8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
"Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x0000000002e8c000 nid=0x2364 in Object.wait() [0x0000000019d4e000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000d5a06c00> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Unknown Source)
at java.lang.ref.Reference.tryHandlePending(Unknown Source)
- locked <0x00000000d5a06c00> (a java.lang.ref.Reference$Lock)
at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
"main" #1 prio=5 os_prio=0 tid=0x0000000002d96000 nid=0x20e8 waiting on condition [0x0000000002d8f000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at javamain1.main(javamain1.java:7)
"VM Thread" os_prio=2 tid=0x0000000017e78800 nid=0x2634 runnable
"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x0000000002dac000 nid=0x28b8 runnable
"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x0000000002dad800 nid=0x1070 runnable
"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x0000000002daf000 nid=0x1d9c runnable
"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x0000000002db1800 nid=0x2054 runnable
"GC task thread#4 (ParallelGC)" os_prio=0 tid=0x0000000002db2800 nid=0x270c runnable
"GC task thread#5 (ParallelGC)" os_prio=0 tid=0x0000000002db3800 nid=0x1778 runnable
"GC task thread#6 (ParallelGC)" os_prio=0 tid=0x0000000002db7000 nid=0x1440 runnable
"GC task thread#7 (ParallelGC)" os_prio=0 tid=0x0000000002db8000 nid=0xa68 runnable
"VM Periodic Task Thread" os_prio=2 tid=0x0000000019e48000 nid=0x2c4 waiting on condition
JNI global references: 4
Heap
PSYoungGen total 38400K, used 1996K [0x00000000d5a00000, 0x00000000d8480000, 0x0000000100000000)
eden space 33280K, 6% used [0x00000000d5a00000,0x00000000d5bf33b8,0x00000000d7a80000)
from space 5120K, 0% used [0x00000000d7f80000,0x00000000d7f80000,0x00000000d8480000)
to space 5120K, 0% used [0x00000000d7a80000,0x00000000d7a80000,0x00000000d7f80000)
ParOldGen total 87552K, used 0K [0x0000000080e00000, 0x0000000086380000, 0x00000000d5a00000)
object space 87552K, 0% used [0x0000000080e00000,0x0000000080e00000,0x0000000086380000)
Metaspace used 2464K, capacity 4486K, committed 4864K, reserved 1056768K
class space used 273K, capacity 386K, committed 512K, reserved 1048576K