0

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.

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.

I have a servlet like so:

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("<html><h2>My message here!</h2></html>");
        writer.close();
    }
}

When I change the message and save, I hope to find it changed in the browser

  • Please see https://zeroturnaround.com/software/jrebel/quickstart/intellij/enable-automatic-compilation-in-intellij-idea/ and https://www.jetbrains.com/help/idea/updating-applications-on-application-servers.html if you want to deploy from IntelliJ IDEA. – CrazyCoder May 30 '19 at 21:03
  • Thank you for the reply! The first link, I already knew, I even wrote about the settings in my question. About the second link, I don't own the Ultimate edition, so it doesn't apply to my situation. – William Farah Sanches May 31 '19 at 22:42

0 Answers0