Access restriction:The type HttpServer is not accessible due to restriction on required library

Copyright: Copyright Rights Reserved https://blog.csdn.net/weixin_39921821/article/details/90450103

Today, when writing Http server, stick around the code above reported such a mistake:

as follows:

Access restriction:The type HttpServer is not accessible due to restriction on required library D:\Java|jdk1.6.0_45\jre\lib\rt.jar

Through the Internet to find that the original is the lack of error specified jar package under the address myself. . . . .

Therefore, in accordance error D: \ Java | jdk1.6.0_45 \ jre \ lib \ rt.jar find this jar package, and then copy it inside your project, then the jar package introduces enough.

Figure:

When looking online and found some friends of friends there are different problems, the situation also said he encountered at:

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

Yes, he is also the case:

The C: \ Program Files \ Java \ jdk1.6.0_02 \ jre \ lib \ ext \ jar package under the servlet-api.jar into the lib project and introduced enough.

Guess you like

Origin blog.csdn.net/weixin_39921821/article/details/90450103