Eclipse 关于“The type * is not accessible due to restriction on required library”问题的解决办法

时间:2024-01-16 22:11:32

The type * is not accessible due to restriction on required library”的错误, 意思是所需要的类库由于受限制无法访问。

解决办法:

1.选中项目->右键->进入Properties视图,选中Java Build Path->点击Libraries->展开JRE System Library[JavaSE-1.6],选中Access rules这一项。如图:Eclipse 关于“The type * is not accessible due to restriction on required library”问题的解决办法

2.Edit->点击Add->在Rule Pattern(规则式样)编辑你允许导入的类库,如(org/**),允许就是在Resolution选项中选中Accessible(当然,有些项目需要可以选择Forbidden、Discourage某些类库)

Eclipse 关于“The type * is not accessible due to restriction on required library”问题的解决办法

参考网址:http://blog.sina.com.cn/s/blog_4a40b8530100ufli.html