javac -classpath "/opt/tomcat/lib/servlet-api.jar" /opt/tomcat/webapps/ROOT/WEB-INF/classes/NewServlet.java
I have tried replacing the javax.servlet with "jakarta.servlet". It still throws the same error with "package jakarta.servlet" does not exist.
I have included the servlet-api.jar while compiling the program. Nothing seems to work here. I am stuck with this for 3 days now. I am a newbie to the servlet. I am not using any IDE. My tomcat is running fine and it is showing the results but the class with these packages are not getting compiled and hence unable to process the following page.
I am using tomcat 10 and linux mint 20.1 .