Saturday, August 24, 2013

Access restriction: The method ... from the type ... is not accessible due to restriction on required library

Here's a fun one...

Got this error suddenly on a Java project in Eclipse that had been working fine previously.

Access restriction: The method [some method] from the type [some class] is not accessible due to restriction on required library [path to some Java jdk jar]

Fix:

Right click on project, click properties.
Choose Java Build Path on left, Libraries tab.
Select JRE, select Edit..

 



Instead of Execution environment...























Choose alternate JRE and click Finish, then OK.



Code compiles.