title: How to build automatically in IntelliJ-IDEA?
body: <p>I am learning how to build a Java project in IntelliJ. But I can't make it build automatically, while running the Jetty:run command.</p>
  
  <p>I already set the IDE to autobuild when saving and to build when idle for 10 secs, and set the compiler.automake.allow.when.app.running to 1. All of these methods worked doing in my mac, but in windows it doesn't work.</p>
  
  <p>I have a servlet like so:</p>
  
  <pre class="lang-java prettyprint-override"><code>package br.com.alura.maven.lojaweb;
  
  import java.io.IOException;
  import java.io.PrintWriter;
  
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  @WebServlet(urlPatterns={"/contato"})
  public class ContatoServlet extends HttpServlet{
  
      @Override
      protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
          PrintWriter writer = resp.getWriter();
          writer.println("&lt;html&gt;&lt;h2&gt;My message here!&lt;/h2&gt;&lt;/html&gt;");
          writer.close();
      }
  }
  </code></pre>
  
  <p>When I change the message and save, I hope to find it changed in the browser</p>