错误: **Access restriction: The type ‘WebServlet’ is not API (restriction on required library ‘D:\Program Files\Java\jdk1.8.0_40\jre\lib\ext\servlet-api.jar’)**
小白一只,在学习JSP配置环境的时候就遇到了很多问题。这是我经常遇到的问题,每次在eclipse里面重新配置tomcat就会报错,网上有多种方法,但最后还是这两种方法解决了,分享给大家,说不定你也和我遇到了一样的问题。 方法一: 右键工程->Preferences ->java builder path->Libraries->将JRE System Library 给remove->add Library->Server Runtime->Apache Tomcat v7.0->Finish; 方法二: Eclipse 默认把这些受访问限制的API设成了ERROR。 Windows -> Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning
|