Access restriction: The type is not accessible due to restriction on required library問題處理
在做Java時,遇到了個小問題,在Import 包資源時出現:
Access restriction: The type XXX is not accessible due to restriction on required library 錯誤!如下圖:
經過查證 原來是:JDK下如rt.jar包中某些資源預設是不讓用的。這是其Access規則,在網上看到很多帖子都說把Warning的驗證禁用掉,個人感覺這不是好的辦法。
經過一些資料發現修改專案檔案的Access rules可以解決這一問題:
選擇工程專案右鍵->Properties->java builder path->Libraries,點選JRE System Library裡面的Access rules,增加或者是Edit Resolution
有關Rule Pattern的輸入,因為我這裡是在Import JDK下rt.jar中的sun包下某個類時出現錯誤,所以我這就填寫sun/**
如果是其他的包,則填寫相應的即可!點選確定後,即可成功解決上面的問題。
相關推薦
錯誤總結:Access restriction: The type ** is not accessible due to restriction on required library
來到新公司,下載程式碼檢視後發現有很多地方標紅報錯了. 仔細一看都是Access restriction: The type ** is not accessible due to restriction on required library型別的錯誤,這種
Access restriction: The type is not accessible due to restriction on required library問題處理
在做Java時,遇到了個小問題,在Import 包資源時出現: Access restriction: The type XXX is not accessible due to re
Access restriction: The type JPEGCodec is not accessible due to restriction on required library
eclipse的設定問題,它預設把這些受訪問限制的API設成了ERROR,你只要把 Windows-Preferences-Java-Complicer-Errors/Warnings 裡面的Deprecated and restricted API中的Forbidden referen
msg=SolrCore ‘collection1‘ is not available due to
異常異常信息: msg=SolrCore ‘collection1‘ is not available due to init failure: Could not load conf for core collection1: Error loading solr config from solr/col
rancher報錯ERROR: http://192.168.200.8:8080/v1 is not accessible (Failed to connect to 192.168.200.8 p
報錯前 INFO: Running Agent Registration Process, CATTLE_URL=http://192.168.200.8:8080/v1 INFO: Attempting to connect to: http://192.168.200.8:8080/v1 E
Android -- the project was not built due to a resource exists with a different case...
進行編碼時,工程前面莫名有個紅X,正當百思不得其解時,發現在[problems]下有如下的訊息輸出 ------ the project was not built due to a resource exists with a different case... ---
eclipse(優化八) eclipse maven專案報錯:Access restriction: The type 'Timestamp' is not API
報錯描述: Access restriction: The type 'Timestamp' is not API (restriction on required library 'C:\Program Files\Java\jdk1.7.0_25\jre\lib\rt.jar')
eclipse錯誤:Access restriction: The type 'BASE64Decoder' is not API
Access restriction: The type ‘BASE64Decoder’ is not API (restriction on required library ‘D:\java\jdk1.7.0_45\jre\lib\rt.jar’) 解決其實很簡單,把JRE System Library
Access restriction: The type XMLSerializer is not API (restriction on required library rt.jar
問題 使用 com.sun.org.apache.xml.internal.serialize.OutputFormat 生成XML時找不到這個類,顯示受限制的rt.jar包 方案 右鍵專案 --> properties --> java B
Access restriction: The type 'JPEGCodec' is not API
ssi cat jpeg .net jre warning 今天 req tail 問題 今天導入項目時Eclipse報錯如下: Access restriction: The type ‘JPEGCodec‘ is not API (restriction on requ
Access restriction: The type 'XXX' is not API (restriction on required library 'C:\Progra
1.問題 Eclipse 編譯錯誤: Access restriction: The type 'xxx' is not API (restriction on required library 'C:\Progra。。。 我引入一個 import sun.misc
Access restriction: The type 'Unsafe' is not API
war .net gmail forbidden window access compile acc ng- 錯誤:Access restriction: The type ‘Unsafe‘ is not API Eclipse中有一種叫做存取限制的機制,來防止你錯誤使用
angularjs post Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.
報錯 lencod pre () ons flight nbsp urlencode 請求參數 現象: 1. angular http 不配置data(請求參數)時不報錯 2. 加上請求參數後,報錯 3. 服務端response.headers().set(HttpHead
ssm+vue 使用shiro後 post請求報錯 Request header field Content-Type is not allowed by Access-Control-Allow-H
ssm+vue 使用shiro後 post請求報錯 Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response. 出現的問題
AndroidN載入私有庫時報錯:xxx is not accessible for the namespace
谷歌從Android N開始,除了那些在Android NDK提供的庫之外,限制了應用對系統私有庫的載入。既然是限制了,想通過以前的方法去載入庫已經行不通了。暫時想到兩種解決方法,目的是將缺少的so檔案放入apk中的lib目錄中。1.在Android.mk中新增缺少的so檔案
Android N載入系統私有庫時出現is not accessible for the namespace錯誤和針對該錯誤的解決方法
谷歌從Android N開始,除了那些在Android NDK提供的庫之外,限制了應用對系統私有庫的載入。既然是限制了,想通過以前的方法去載入庫已經行不通了。所以目前的解決方法就是把應用需要載入的庫和需要依賴的庫從系統中pull出來,然後整合到自己的應用當中。本文是看了這篇
vue-resource Content-Type is not allowed by Access-Control-Allow-Headers in preflight response
朋友剛問了一個問題 用JQuery Ajax 請求的時候沒有問題,正常請求該介面。 但是換成vue-resouce 時會報如上的錯。 後來經過查詢發現時 發現是Content-type 問題 vue-resource 請求時候 requests encoded 為 a
JAVA錯誤提示:The operation is not applicable to the current selection.Select a field which is not declared as type variable or a type that declares such f
平時沒怎麼注意,今天用Eclipse自動生成Set Get方法時提示錯誤,錯誤資訊如下: The operation is not applicable to the current selection.Select a field which is not declared as type varia
web登錄zabbix報DB type is not set
db type is not set今天通過web訪問zabbix的時候,報如下錯誤查看關於zabbix的web界面設置的php文件,不知道為啥變成了空文件,報錯原因get!好在這個文件是有模板的,不用自己從零開始配置,下面看看這個模板文件的內容[[email protected]/* */ ~]
【問題記錄系列】the resource is not on the build path of a java project
搭建 關閉 spring源碼 remove 環境 eclips 右鍵 生產 ldp 在eclipse中新建了一個maven項目搭建Spring源碼閱讀環境,創建一個bean生產getter和setter方法的時候報錯“the resource is not on the b