I have a maven servlet project, and I created executable jar for that project like show in this link: Is it possible to build a java project only once using eclipse and share?
But after creating jar file I run it by using
java -jar Task-jar-with-dependencies.jar
I got error
main method not found.
I am new to these concepts and I don’t know how to define main method in servlet program.
My program is
public class service extends HttpServlet{
protected void doPost(HttpServletRequest req, HttpServletResponse resp){
…..
…..
}
}
I am using tomcat.
Edited with info from comments
It is possible for me to send request using postman. I want to know how to generate an executable jar file and execute a class using the jar file also by using maven profile how to export project as a executable jar and execute it, I want to know them in general I just mentioned that example code for specifying in which area Iam working