2010-02-23 283 views

回答

1

單擊該項目,選擇屬性,轉到Java Build Path ..添加jar或添加外部jar應該解決您的問題。

+0

對同一工作區中其他項目的依賴性如何?看起來那些不起作用。 – smiron 2014-01-28 12:33:20

0

如何解決什麼插件添加到我需要知道添加了什麼依賴(一個Eclipse插件),以及如何將其添加到依賴

。我在Java代碼中得到的錯誤是:

The type org.eclipse.jface.text.source.Annotation cannot be resolved. It is indirectly referenced from required .class files 

在java「包」語句和:

The hierarchy of the type JavaDecodePlugin is inconsistent 

要查找插件提供的註釋I類搜索的的「插件」目錄在Eclipse的代碼是我的(窗口)機(\程序\ androidDev \日食)上安裝的那個類的引用:

C:\app\androidDev\eclipse\plugins>grep -r org.eclipse.jface.text.source.Annotation * 
Binary file org.eclipse.jface.text_3.8.2.v20121126-164145.jar matches 
Binary file org.eclipse.text_3.5.200.v20120523-1310.jar matches 

它在兩個插件/罐被引用。我搜尋了所需課程的罐子。第一個插件/ jar沒有包含它,第二個插件。

C:\app\androidDev\eclipse\plugins>jar -tf org.eclipse.jface.text_3.8.2.v20121126-164145.jar |grep Annotations 
org/eclipse/jface/text/link/LinkedPositionAnnotations.class 
org/eclipse/jface/text/source/projection/ProjectionSupport$ProjectionAnnotationsPainter.class 

C:\app\androidDev\eclipse\plugins>jar -tf org.eclipse.text_3.5.200.v20120523-1310.jar |grep Annotations 
org/eclipse/jface/text/source/Annotation.class 
org/eclipse/jface/text/source/AnnotationMap.class 
org/eclipse/jface/text/source/AnnotationModel$1.class 
org/eclipse/jface/text/source/AnnotationModel$2.class 
org/eclipse/jface/text/source/AnnotationModel$AnnotationsInterator.class 
org/eclipse/jface/text/source/AnnotationModel$InternalModelListener.class 
org/eclipse/jface/text/source/AnnotationModel$MetaIterator.class 
org/eclipse/jface/text/source/AnnotationModel$RegionIterator.class 
org/eclipse/jface/text/source/AnnotationModel.class 
org/eclipse/jface/text/source/AnnotationModelEvent.class 

,所以我知道我現在需要的插件。由於Plug-in Dependencies顯示(如上面的答案)您需要去'包資源管理器'展開'META-INF',打開'MANIFEST.MF',打開'依賴關係'選項卡並點擊'必需'按鈕插件「部分,在」選擇插件「文本區域中鍵入插件名稱的一部分,讓它找到插件的完整名稱(也許選擇所需的插件),然後單擊確定。

(這個答案有些所以如果我要再次做到這一點後,我忘了我做什麼,我和你,會知道記錄的過程)

相關問題