Created a sample.jsh
file with below code
while(true){}
Now i ran below command
jshell sample.jsh
It internally creates 2 process one is jshell process and another one is java process and java process is taking 100% cpu utilization.
How to kill java process after some timeout ?
Note: All above steps will done by programatically not manually, so i can kill jshell process after certain time because jshell command ran by my code, but java process created by jshell so i unable to kill by programatically.