在java中导入访问限制 [英] Import access restriction in java

查看:155
本文介绍了在java中导入访问限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码中有这个导入:

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?

推荐答案

看看这里:由于对所需库rt.jar的限制,对类的访问限制?

它与您的问题不完全重复,但有些答案是相关的。以下是引号:

It is not exact duplicate to your question but some answers are relevant. Here are the quotes:

http://www.digizol.com/2008/09/eclipse-access-restriction-on-library.html 最适合我。

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中导入访问限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆