---
title: "Access restriction: The type * is not accessible due to restrict"
author: "zps_77"
date: "2013-03-14T15:22:31Z"
tags: []
categories: ["开源软件"]
slug: "access-restriction-the-type-is-not-accessible-due-to-restrict"
draft: false
lastmod: "2013-03-14T15:22:31Z"
id: 1829362
url: "https://geven7.iteye.com/blog/1829362"
---

报错信息:Access restriction: The type TaskTopicResolver is not accessible due to restriction on required library NC\_DEMO/NC\_HOME/modules/uap/META-INF/lib/uapplatform.jar 

解决方案1： 

Eclipse 默认把这些受访问限制的API设成了ERROR。   
Windows -&gt; Preferences -&gt; Java -&gt; Compiler -&gt; Errors/Warnings -&gt;   
Deprecated and trstricted API -&gt; Forbidden reference (access rules): -&gt; change to warning 

解决方案2：   
只需要在project build path中先移除JRE System Library，再添加库JRE System Library，重新编译后就一切正常了。 

解决方案3： 

工程上右键-&gt;工程属性-&gt;java builder path-&gt;Libraries标签，点击JRE System Library里面的Access rules，add sun/\** 为accessible，如果该项存在，就edit。 

解决方案4： 

Windows -&gt; Preferences -&gt; Java -&gt; Installed JREs -&gt; 选择用的JDK -&gt; Edit -&gt; Add External JARs