问 :import sun.management.ManagementFactory,我在rt包下已经找到sun.management.ManagementFactory,但就是有错,请问怎么回事。

答:Eclipse默认将这些受访问限制的API设成了Error。
解决方法:
只要将Windows---Preferences---Java--Complicer---Errors/Warings里面的Deprecated and restricted API中的Forbidden references(access rules) 选为Waring就可以编译过了。

在编写代码时,突然出现:Access restriction: The type Launcher is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar错误,解决办法,在java build path中先移除jre system library,然后重新将jre system library重新add进来。===========》这样也解决了!!!!

java的Access restriction错误的更多相关文章

  1. Access restriction错误解决办法

    Access restriction错误, XX方法 is not accessible due to restriction on required library XXlib 解决方案: Ecli ...

  2. Java中Access restriction:····的解决方法

    http://blog.csdn.net/bit2012_2015/article/details/22798779 ————————————————————————————————————————— ...

  3. Java,AWTUtilities,eclipse报编译错误:Access restriction: The type 'AWTUtilities' is not API (restriction on required library 'C:\Program Files\Java\jre7\lib\rt.jar')

    [场景]调用com.sun.awt.AWTUtilities时,eclipse提示编译错误: Access restriction: The type 'AWTUtilities' is not AP ...

  4. java常见错误--Access restriction: The type BASE64Encoder

    Access restriction: The type BASE64Encoder is not accessible due to restrict 在Eclipse中编写Java代码时,用到了B ...

  5. Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案

    报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C ...

  6. Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar

    解决方法: Project -> Properties -> libraries, 先remove掉JRE System Library,然后再Add Library重新加入. ===== ...

  7. Access restriction: The constructor SunJCE() is not accessible 错误

    Access restriction: The type 'SunJCE' is not API (restriction on required library 'C:\Program Files\ ...

  8. 怎么在eclipse中查到这个类用的是哪个jar的类和Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案

    找到了一个办法,你先按F3,然后点击Change Attached Source..按钮,在弹出的框里有个路径,我的路径是D:/SNFWorkSpace/JAR/~importu9.jar,然后你去引 ...

  9. eclipse错误:Access restriction: The type 'BASE64Decoder' is not API

    Access restriction: The type ‘BASE64Decoder’ is not API (restriction on required library ‘D:\java\jd ...

随机推荐

  1. ui设计的好网站(转载)

    设计师网址导航  http://hao.uisdc.com/ 站酷 国外: Dribbble - Show and tell for designers.Behance 这两个网站就够了啊 ————— ...

  2. CodeForces - 316E3 Summer Homework

    Discription By the age of three Smart Beaver mastered all arithmetic operations and got this summer ...

  3. iOS7自定义back按钮和pop交互手势

    Clambake for iPhone有一个回退按钮在所有的导航条上.这是一个简单的没有文字箭头. 实现一个自定义按钮是简单的.类似这个设置controller 的navigationItem一个le ...

  4. Using Single Alert For Messages And Confirmation Messages In Oracle Forms With Set_Alert_Button_Property

    Learn how to use single Oracle Form's Alert object for warning/information messages and confirmation ...

  5. Oracle rac配置Weblogic数据源(实例名及URL的选择)

    这几天,应用程序后台一直报无法取得连数据库接池.但之前从来没有这个问题,迁移到Weblogic后才发生. 之后据了解,我们服务器上的Oracle 10G 是 RAC 的,即有两个节点. 两个节点 IP ...

  6. TypeError at /post/ render_to_response() got an unexpected keyword argument 'context_instance'

    Exception Type: TypeError at /post/ Exception Value: render_to_response() got an unexpected keyword ...

  7. WEB API 返回类型设置为JSON 【转】

    http://blog.sina.com.cn/s/blog_60ba16ed0102uzc7.html web api写api接口时默认返回的是把你的对象序列化后以XML形式返回,那么怎样才能让其返 ...

  8. linux中nl用法

    linux 中nl 命令使用 nl :添加行号打印 -b:   指定行号指定的方式,主要有两种:    -b a : 表示不论是否为空行,都同样列出行号    -b t : 如果有空行,则不列出那一行 ...

  9. AutoIT V3如何修改字体

    1 如图所示,文字很小,阅读和编写多很吃力.   2 按住Ctrl,鼠标滚轮上下滚动可以改变字体大小.   3 如何修改界面的字体,比如改为微软雅黑的字体,现在还没有一个好的解决方案,大家先将就着用吧 ...

  10. bat文件转换为exe文件

    批处理文件转换为exe文件(简单的处理文件),点击下载 使用超简单的了,不多说.