The type java.lang.AutoCloseable cannot be resolved. It is indirectly referenced from required .clas

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了The type java.lang.AutoCloseable cannot be resolved. It is indirectly referenced from required .clas相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/pre' title='pre'>pre   add   col   瑙e喅   closeable   mic   inf   ref   type   

 

鍑虹幇闂锛?/span>

The type java.lang.AutoCloseable cannot be resolved. It is indirectly referenced from required .class files

鎶€鏈浘鐗? src=

鍘熷洜锛?/strong>

杩欐槸涓€涓?ldquo;绫诲瀷鍒癹ava.lang.charsequence涓嶈兘瑙e喅”鐨勯敊璇€傝繖涓富瑕佹槸鐢变簬MyEclipse寮曠敤浜嗕笉鍚岀増鏈殑jdk宸ョ▼鍗板彂鐨勯棶棰樸€傛垜浠兘鐭ラ亾锛屾瘡娆℃柊寤轰竴涓伐绋嬫椂锛孧yEclipse閮戒細璁╂垜浠€夋嫨瑕佷娇鐢ㄧ殑jdk鐗堟湰锛岃€屾垜鐨勭數鑴戜笂鏈塲dk1.6鍜宩dk1.7鍜宩dk1.9涓変釜鐗堟湰銆傛墍浠ュ綋鐢佃剳涓婃湁澶氫釜鐗堟湰鐨刯dk鏃讹紝寮€鍙戠幆澧冧細鑷姩閫夋嫨榛樿鐨凧re銆傛墍浠ユ垜浠€氳繃浠ヤ笅鐨勬柟妗堟潵瑙e喅杩欎釜閿欒锛?/p>

瑙e喅鏂规锛?/span>鏇存崲IDE鎴栬€呮洿鏀笿DK銆?/p>

鎴戞彁渚涗竴绉嶈В鍐虫柟娉曪細鏇存崲JDK鐗堟湰銆?/p>

鍏蜂綋鎿嶄綔锛?/p>

1.鎸夌収杩欎釜璺緞杩涘叆锛歐indow->preferences->java->Installed JREs锛?/p>

銆€銆€鐪嬪埌榛樿鎯呭喌涓嬶紝鎴慖DE浣跨敤鐨勬槸JDK1.6鐗堟湰銆?/p>

 鎶€鏈浘鐗? src=

2.鐐瑰嚮add锛屾坊鍔燩C涓婄殑鍚堥€傜殑jdk

鎶€鏈浘鐗? src=

 

 鎶€鏈浘鐗? src=

3.鎵惧埌PC瀹夎jdk鐨勭洰褰?鎵捐嚜宸辩殑瀹夎鐩綍)锛岄€夋嫨涓€涓笉鍚岀殑jdk鍗冲彲--------涓嶆槸閫夋嫨jre.

 鎶€鏈浘鐗? src=

 鎶€鏈浘鐗? src=

 

4.娣诲姞涔嬪悗锛屽涓€涓紝鐒跺悗鏇存崲灏卞喅缁濋棶棰樹簡銆?/p>

鎶€鏈浘鐗? src=

 

鎶€鏈浘鐗? src=

以上是关于The type java.lang.AutoCloseable cannot be resolved. It is indirectly referenced from required .clas的主要内容,如果未能解决你的问题,请参考以下文章

[WPF]The type name ‘App’ does not exist in the type '...'的问题

The method xx from the type xx refers to the missing type List等问题的解决办法

Array types are now written with the brackets around the element type问题的解决方法

返回suggester的类型(Returning the type of the suggester)

The parameter to the method is the basic data type

The hierarchy of the type is inconsistent错误问题