just installed Intellij 11.0, created a class, then write public class ; AJAXServlet extends HttpServlet {}; just wrote here on the error , suggesting that can not be resolved HttpServlet (cannot resolve symbol'HttpServlet ') manually using the import import this package is also an error , just write to import javax.Servlet here on the error , if it did not find the corresponding packet , expert help , use JDK6.0. , and have tried JDK7 are not imported package servlet corresponding packet . In the automatic prompt no . Seek expert advice , how to deal with . ------ Solution ---------------------------------------- ----
need to import the tomcat server-api.jar
------ For reference only ---------------------- -----------------
Thank you, what you say is right. This is the latest start ide I use, and who are not familiar , will not even turn the jar package . Debugging is not , you can leave a contact exchange it ?
------ For reference only -------------------------------------- -
reason for missing jar package
specific solutions are as follows:
1, the selected item ( in IntelliJ called Module);
2, right click and select open modual settings ( or just press F4);
3, left in the popup window select Libraries;
4, click the plus sign at the top of a similar "+ " icon ;
5, select the first item on the right (Attach Classes ...);
6, in the pop-up window, select the directory where tomcat , enter inside the lib directory to find servlet-api.jar this jar ( if the JSP page is also related to JavaWeb object, you also find jsp- api.jar; if only Servlet, simply select the servlet-api.jar);
7, select the jar package , then click OK.
没有评论:
发表评论