问题描述
我的代码中有这个导入:
I have this import in my code:
import com.sun.jmx.snmp.SnmpOidDatabaseSupport;
但是我收到以下错误:
Access restriction: the type SnmpOidDatabaseSupport is not accessible
due to restriction on required C:\Program Files\Java\jre6\lib\rt.jar
如果可以帮助我的IDE是eclipse,我该如何解决这个错误?
and also if it could help my IDE is eclipse, how can i fix this error?
推荐答案
看看这里:
它与您的问题不完全重复,但有些答案是相关的。以下是引号:
It is not exact duplicate to your question but some answers are relevant. Here are the quotes:
最适合我。
Windows - >首选项 - > Java - >编译器 - >错误/警告 - >已弃用和限制API - >禁止引用(访问规则): - >更改为警告
Windows -> Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning
如果你认为这个答案是有用的,请不要忘记提高我在这里引用的答案。转到上面的URL,找到由@scommab
If you think that this answer is useful please not forget to upvote the answer I quoted here. Go to URL above and find for answer by @scommab
这篇关于在java中导入访问限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!