NewServlet.java:2: error: package javax.servlet does not exist
import javax.servlet.*;
^
NewServlet.java:3: error: package javax.servlet.http does not exist
import javax.servlet.http.*;
I have the jre7 and jdk1.7.0 installed along with the Tomcat 7.0 but it shows this error. servlet.http is not the only one that "does not exist", there are also other (servlet.) components.
Reference1
Reference2
import javax.servlet.*;
^
NewServlet.java:3: error: package javax.servlet.http does not exist
import javax.servlet.http.*;
I have the jre7 and jdk1.7.0 installed along with the Tomcat 7.0 but it shows this error. servlet.http is not the only one that "does not exist", there are also other (servlet.) components.
Got this error on linux because of weird file permissions in tomcat distro. Some files an directories are not readable for other users. I use separate CATALINA_HOME and CATALINA_BASE, so my tomcat is owned by root and is runned by restricted user.
Fixing it like that:
( cd /usr/local/share/tomcat9/ && for file in `find ./ -type d ! -perm -o=r`; do echo "$file"; chmod o+rx "$file"; done && for file in `find ./ ! -perm -o=r`; do echo "$file"; chmod o+r "$file"; done )
for file in `find /usr/local/share/tomcat9/ ! -perm -o=x -name '*.sh'`; do echo "$file"; chmod o+x "$file"; done
Reference2
No comments:
Post a Comment