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



Error message :

Access restriction: The type Name is not accessible due to restriction on required library C:\Program Files\Java\jdk1.5.0_16\jre\lib\rt.jar

  1. Go to the project properties.
  2. Select Build Path settings
  3. Remove the JRE System Library
  4. Add it back; Select "Add Library" and select the JRE System Library. The default worked for me.
This works because you have multiple classes in different jar files. Removing and re-adding the jre lib will make the right classes be first. If you want a fundamental solution make sure you exclude the jar files with the same classes.


Another Solution :

Windows -> Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning



No comments:

Post a Comment

AUTHOR