Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse with JSR 250 (annotation) yields "Access Restriction" errors

Hopefully someone has come across this before. I'm running Spring STS 2.3.0 and when attempting to use the @Resource annotation from javax.annotations.Resource I get "Access restriction: The type Resource is not accessible due to restriction on required library". I'm using the JDK 6u18.

I've tried changing the JDK Compliance to 1.5 and 1.6 and both yield the same error.

Cheers, -Ed

like image 470
edstafford Avatar asked Mar 22 '26 04:03

edstafford


1 Answers

This worked for me: Change eclipse (STS) project build path | Libraries tab | select JRE System Library [J2SE-1.4] | Edit button | change from Execution Environment radio tab which says J2SE 1.4 (jdk1.6.0_21) to Workspace default JRE (jdk1.6.0_21).

like image 93
Wolf Avatar answered Mar 24 '26 17:03

Wolf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!