Access restriction: The type XXX is not accessible due to restriction on required library XXX

今天新建一個類的時候,不少元素報錯,說引用不到:html

 Access restriction: The type NoSuchPortException is not accessible due to restriction on required library C:\Java\jre7\lib\ext\comm.jar
java


 這個comm.jar 是在項目中後來引用的,並非java自帶的,ide



那怎樣解決這個引用不到的問題呢?網上搜到了答案:ui

右擊項目,Build Path -> Configure Build Path,在對話框中選擇 Order and Export 標籤,把comm.jar的位置移動到JRE System Library 的上面3d


效果以下:rest



報錯信息消失。htm

相關文章
相關標籤/搜索