Restriction on required library rt.jar Error

Restriction on required library rt.jar Error

I encountered the following error in my eclipse when I import an existing project.

Access restriction: The type <class name> is not accessible due to restriction on required library C:\Program Files\Java\jdk6\jre\lib\rt.jar

After researching on the internet I found one possible reason is that, may be you are using a class that is only meant to be used by Java itself or may be you are replacing a standard class which ships with Java 6 with one in a library you have. But I can not confirm this.

Solution

The recommended Solution is to get rid of this class and use any alternative

short term Solution is remove the JRE library from your project and Add it again

for example this will work in eclipse

1. Open project properties.
2. Select Java Build Path node.
3. Select Libraries tab.
4. Remove JRE System Library.
5. Add Library JRE System Library.

 

And it works.

I hope both solutions helps

 

 

One Response to “Restriction on required library rt.jar Error”

  1. Natalia Flores Says:

    it reaaaaally helped me :( i was troubled about this! thanks

Leave a Reply

Spam Protection by WP-SpamFree

Einfobuzz Site Map