---
title: "eclipse中Access restriction问题的解决"
author: "paddy.w"
date: "2013-04-24T16:58:31Z"
tags: []
categories: ["编程语言"]
slug: "eclipse-access-restriction"
draft: false
lastmod: "2013-04-24T16:58:21Z"
id: 1852963
url: "https://paddy-w.iteye.com/blog/1852963"
---

如果在Eclipse使用某些访问受限的API时，会报这种错误：
<span style="color:red">**Access restriction: The type Resource is not accessible due to restriction on required library**</span>
这是因为Eclipse默认把这些受访问限制的API设成了ERROR，在java-compiler-Errors/Warnings选项里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过，只是报警告而不是报错，保证了编译能通过。