title: java JShell kill java process
body: <p>Created a <code>sample.jsh</code> file with below code</p>
  
  <pre><code>while(true){}
  </code></pre>
  
  <p>Now i ran below command </p>
  
  <pre><code>jshell sample.jsh
  </code></pre>
  
  <p>It internally creates 2 process one is jshell process and another one is java process and java process is taking 100% cpu utilization. </p>
  
  <p>How to kill java process after some timeout ?</p>
  
  <p>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.</p>