04 May 2009

Eclipse compilation errors on restricted classes access

There is a problem importing the Spring Extensions JCR project into Eclipse after the mvn eclipse:eclipse execution. However this problem is caused by Eclipse warings settings.

"Access restriction: The type RE is not accessible due to restriction on required library /lib/rt.jar". Such errors indicate use of non-API classes and those access rules are defined by Eclipse JDT.

To solve this boring issue you can change compiler settings to not fail on those restrictions in
workspace settings:

Window > Preferences > Java > Compiler > Errors > Warnings > Deprecated and restricted API > Forbidden reference (access rules) >Warnings

Or per-project from:
Project > Properties > Java Compiler > Errors>Warnings > Deprecated and
restricted API > Forbidden reference (access rules) > Warnings

No comments: