title: Gradle is not closing the port after stop the application
body: <p>In Java, I am using <em>Spring</em> and <em>Gradle</em> and having the following issue (that I can't find the answer for!)</p>
  
  <p>I am getting this error again and again when trying to compile... </p>
  
  <pre><code>   FAILURE: Build failed with an exception.
  
      What went wrong:
      Execution failed for task ':bootRun'.
      &gt; Process 'command 'C:\Program Files\Java\jdk1.8.0_131\bin\java.exe'' finished with non-zero exit value 1
  
      Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  </code></pre>
  
  <p>MORE CLUES:</p>
  
  <ul>
  <li>The first time I open intelliJ, it works. Then it doesn't work again</li>
  <li>I am closing the app properly (click the red square), it is not that.</li>
  <li>The process using the port 80 is "java", so java is listening correctly...</li>
  <li>...but it remains open even after closing the app</li>
  <li>If I close and open intelliJ, it works, but after stop the app is says:</li>
  </ul>
  
  <blockquote>
    <p>The daemon will cancel the build.
    Could not execute build using Gradle distribution '<a href="https://services.gradle.org/distributions/gradle-3.5-rc-2-all.zip" rel="nofollow noreferrer">https://services.gradle.org/distributions/gradle-3.5-rc-2-all.zip</a>'.
    12:57:48: External task execution finished 'bootRun'</p>
  </blockquote>
  
  <p>Seems like <em>Gradle</em> is not closing properly my app, and it only works one time, then the port remains open forever even if I click stop (well, until I close <em>IntelliJ</em>!).</p>
  
  <p>Here is my project in Github:</p>
  
  <p><a href="https://github.com/RicSala/project5countries" rel="nofollow noreferrer">https://github.com/RicSala/project5countries</a></p>
  
  <p>I have red EVERYTHING out there to fix it, but nothing helps...</p>
  
  <p>Please help! :)</p>
  
  <p>THANK YOU!</p>