Eclipse warning The type ... Type is not accessible due to restriction on required library ...\jre\lib\rt.jar

When working with Eclipse sometimes arise warning Access restriction: The type ...Type is not accessible due to restriction on required library ...\jre\lib\rt.jar

This situation is possible when used technology (class) is not compatible with used execution environment in Eclipse IDE.

For example using JAX-WS webservice  generated classes arise warning about generated annotation in generated classes. JAX-WS classes support starts from Java 6 version, so you must use corresponding exceution enviroment.

To fix it, you must select project, which has warning, in Navigator or Project Explorer tab, and select "Properties" from context menu:

alt 

Opens project properties window in that you select "Java Build Path":

alt 

then select tab "Libraries". In this tab find and select "JRE System Library" and click button "Edit...":

alt 

Opens window "JRE System Library":

alt 

In this window you can select execution enviroment in that system will run. If system will run in Java 6 enviroment you select J2SE-1.6 enviroment, if in Java 5, then select J2SE-1.5 enviroment. J2SE means Java 2 Platform, Standard Edition.