欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Access restriction required library rt.jar 博客分类: eclipse eclipsejavart.jarAccess restriction required library 

程序员文章站 2024-03-18 18:20:22
...

        在JAVA项目开发中,编辑运行时出现以下错误:Access restriction required library rt.jar,这里就详细的说明一下如何解决这个问题。

        经分析,出现此问题是因为Eclipse的JDK是从System library的Execution environment中选择的。

Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
        解决方法:

一.重新加入自已安装的JDK 

1.进入Project —> Properties —> Java Build Path —> Libraries

2.remove 掉 JRE System Library

3.Add Library 重新加入JRE System Library

Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
        添加后即可解决此问题。

 

二.设置访问策略

1.点击项目菜单—>属性

Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
2.点击左侧的“JAVA Build Path”。

Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
3.切换到“Libraries”标签,选中“Access rules”,点击“Edit”。

Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
4.点击“Add”按钮。

Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
5.Resolution选择Accessible,Rules Pattern输入“**”,点击OK。

Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
6.成功添加一条规则,点击OK。

Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
7.这时你会发现Access rules的值已经改变,点击OK问题就解决啦。

Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 

参考文章:http://jingyan.baidu.com/article/e73e26c0da800224adb6a7b5.html

  • Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
  • 大小: 15.5 KB
  • Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
  • 大小: 54.6 KB
  • Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
  • 大小: 54.9 KB
  • Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
  • 大小: 21.3 KB
  • Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
  • 大小: 50.8 KB
  • Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
  • 大小: 80.6 KB
  • Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
  • 大小: 28.7 KB
  • Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
  • 大小: 34.6 KB
  • Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
  • 大小: 36.7 KB
  • Access restriction required library rt.jar
            
    
    博客分类: eclipse eclipsejavart.jarAccess restriction required library 
  • 大小: 88.6 KB