[Eclipse] Access restriction: Class is not accessi
阿新 • • 發佈:2019-01-24
"Access restriction: Class is not accessible due to restriction on required library"; error message may be shown while developing Java projects in Eclipse
IDE
. Error message is self-explanatory, some classes can not be loaded into the project since restriction rules are being imposed on those classes.
"Warning" or "Ignore" options will only hide the potential issue in the project, by allowing the project to use any classes ignoring predefined access rules. To completely resolve this issue, analyze the project and located the use of restricted classes and take necessary actions (either remove those references or access rules).
How to solve
This error message can be removed by changing a setting inside Eclipse IDE. Open up the dialog box shown below, using any of the following paths.- Windows -> Preferences -> Java ->
- (Project) Properties -> Java Compiler -> Errors/Warnings
"Warning" or "Ignore" options will only hide the potential issue in the project, by allowing the project to use any classes ignoring predefined access rules. To completely resolve this issue, analyze the project and located the use of restricted classes and take necessary actions (either remove those references or access rules).