title: Solution to "java.net.BindException: Address already in use" error?
body: <p>I'm using Intellij, attempting to deploy a Tomcat application, but whenever I try to run it, I get the following error: </p>
  
  <pre><code>Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 1098; nested exception is: 
  java.net.BindException: Address already in use
  </code></pre>
  
  <p>Now I've manually looked for the process happening at that port via: </p>
  
  <pre><code>lsof -i:1098
  </code></pre>
  
  <p>And I found the java process and killed it too: </p>
  
  <pre><code>ps aux | grep java
  
  kill -9 20386
  </code></pre>
  
  <p>And that worked, but I have to do this EVERYTIME I open Intellij. If I want to rerun the server without exiting Intellij, I can't, because I'll get this error. Does anyone know of a permanent fix for this and not just manually killing it everytime?</p>