Access restriction The type Resource is not API
While working with java and when you import new project or cleaned you old project or took clean build of the project, you get below exception:
Access restriction: The type ‘Resource’ is not API (restriction on required library ‘C:\Program Files (x86)\Java\jdk1.8.0_51\jre\lib\rt.jar’)
- In eclipse you will as below:
- Solution: This happens if in your class path JDK build path got mismatched. As you see below my eclipse JDK path got messed up and now J2SE-1.5 is pointing to JDK 1.8.0_51 and eclipse shows clearly this warning:
- To fix this issue please change to proper JDK. In my case I was using JDK 1.8 so I had to change to this version:
Also don’t forget to change compiler version:
Reference:
thanks!!! This is the only answer that really help me in the entire internet!
Works! Thanks a lot !!