title: Bash script does not end Java process clicking on the "X"
body: <p>Can someone explain to me why this is the case. Let's say I have a simple java program that loops forever until I kill the process.</p>
  
  <p>If I make a shell script like this.</p>
  
  <pre><code>#!/bin/bash
  
  # clears the terminal
  clear
  
  # runs the java executable
  java -jar java_program.jar
  
  # prevents the terminal from  closing
  $SHELL
  </code></pre>
  
  <p>The shell script runs the program and if I use hotkey CTRL + C it ends the java process exactly how I want it. But when I use the "X" in the top right corner the java process does not end. Why does it do this how do I solve this issue?</p>
  
  <p>I know the java process does not end because if I look in task manager the process is still running.</p>
  
  <p>I am using windows 10.</p>
  
  <p><a href="https://i.stack.imgur.com/Mptli.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mptli.png" alt="task"></a></p>