How to add hang in eclipse

I want to know why and how to add a plug-in dependency for any project in eclipse.

+4
source share
3 answers

Click on a project, select properties, go to Java Build Path .. add banks or add external banks to solve your problem.

+1
source

How to allow which plugin to add depending

I needed to know which dependency to add (to the Eclipse plug-in), and also how to add it. The errors I received in Java code were:

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

in java package instructions and:

 The hierarchy of the type JavaDecodePlugin is inconsistent 

To find out which plugin provided the Annotation class, I looked for the β€œplugins” directory of where the Eclipse code was installed on my machine (windows) (\ app \ androidDev \ eclipse) to reference this class:

 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 

it was listed in two plugins / banks. I was looking for cans for the desired class. The first plugin / gang did not contain it, the second did.

 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 

So, I knew which plugin I needed now. Since the "Plug-in parameters" shows (as in the answer above), you need to go to the "Package Explorer", expand "META-INF", open 'MANIFEST.MF', open the "Dependencies" tab and click the "Add" button in the section "Required plug-ins", enter the part of the plug-in name in the "Select the text area of ​​the plug-in" field, it will find the full name of the plug-in (maybe select the plug-in you want) and click "OK".

(This answer documents the process somewhat, so if I need to do it again when I forget what I did, I will find out)

0
source

Source: https://habr.com/ru/post/1302136/


All Articles