The type HttpExchange is not accessible due to restriction on required library 错误
2014-04-10 17:25
281 查看
参考:http://stackoverflow.com/questions/860187/access-restriction-on-class-due-to-restriction-on-required-library-rt-jar
问题描述:
import com.sun.net.httpserver.HttpExchange;
报错
Access restriction: The type HttpExchange is not accessible due torestriction on required library C:\Program Files\Java\jre7\lib\rt.jar
解决:
将 JRE System Library 从 Libraries 中删除,然后重新添加 JRE
System Library
原因:
工程中存在多个jar中的多个class冲突,其中只有一个class是正确的class。
删除 JRE
System Library 后重新添加,会让正确的class成为首选class,从而被正确找到。
(This
works because you have multiple classes in different jar files. Removing and re-adding the jre lib will make the right classes be first. If you want a fundamental solution make sure you exclude the jar files with the same classes.)
问题描述:
import com.sun.net.httpserver.HttpExchange;
报错
Access restriction: The type HttpExchange is not accessible due torestriction on required library C:\Program Files\Java\jre7\lib\rt.jar
解决:
将 JRE System Library 从 Libraries 中删除,然后重新添加 JRE
System Library
原因:
工程中存在多个jar中的多个class冲突,其中只有一个class是正确的class。
删除 JRE
System Library 后重新添加,会让正确的class成为首选class,从而被正确找到。
(This
works because you have multiple classes in different jar files. Removing and re-adding the jre lib will make the right classes be first. If you want a fundamental solution make sure you exclude the jar files with the same classes.)
相关文章推荐
- 错误总结:Access restriction: The type ** is not accessible due to restriction on required library
- java 错误:Access restriction: The type Resource is not accessible due to restriction on required library
- Access restriction: The type HttpServlet is not accessible due to restriction on required library xxxx\servlet-api.jar
- 错误解决:The type [X] is not accessible due to restriction on required library [Y].
- The type ProxyGenerator is not accessible due to restriction on required library问题的解决
- Access restriction: The type Node is not accessible due to restriction on required library C: \Prog
- Access restriction: The type Resource is not accessible due to restriction on required library
- The type JOptionPane is not accessible due to restriction on required library
- Access restriction: The type JPEGCodec is not accessible due to restriction on required library
- Access restriction: The type XXXX is not accessible due to restriction on required library
- 报错: Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required library
- Access restriction: The type Resource is not accessible due to restriction on required library
- Access restriction: The type XXX is not accessible due to restriction on required library XXX
- Access restriction: The type FtpClient is not accessible due to restriction on required library
- Access restriction: The type XXX is not accessible due to restriction on required library XXX
- Access restriction: The type XXXX is not accessible due to restriction on required library的解决办法
- Access restriction: The type XXX is not accessible due to restriction on required library XXX
- (Error) The type AESKeyGenerator is not accessible due to restriction on required library.
- 报错: The type ByteInputStream is not accessible due to restriction on required library
- Access restriction: The type Resource is not accessible due to restriction on required library