Java – Access restriction on class due to restriction on required library

eclipsejava

I get this error message in Eclipse:

Access restriction: The type DirectoryWalker is not accessible
due to restriction on required library 
/Library/Java/Extensions/commons-io-1.4.jar

what does this mean? There's this other SO question on the same topic but it doesn't seem to apply in this case. I'm not creating a new java class, I'm trying to use one.

Best Solution

go to java build path and under Library tab, remove JRE System Library. Then again Add Library --> JRE System Library

Worked for me