Access restriction: The type HttpServlet is not accessible due to restriction on required library xxxx\servlet-api.jar

在Eclipse是新建一个Servlet文件, 报错

Access restriction: The type HttpServlet is not accessible due to restriction on required library C:\Program Files\Java\jdk1.6.0_02\jre\lib\ext\servlet-api.jar

 

解决方法

把C:\Program Files\Java\jdk1.6.0_02\jre\lib\ext\servlet-api.jar 拷贝到项目的 lib下就没报错了。

你可能感兴趣的:(servlet)