Search code examples
javaeclipseabstract-syntax-treeeclipse-jdt

How to use eclipse JDT plugin


I installed JDT plugin (I'm running Eclipse 4.2.1) but Eclipse doesn't recognize some types and classes. For example I got "CompilationUnit cannot be resolved to a type". Do I have to import something Eclipse doesn't suggest?


Solution

  • If you are trying to use the JDT libraries in an eclipse plugin project, you will have to add the org.eclipse.jdt.core to the plugin dependencies (in the plugin.xml file).

    Else if you are trying to add these to a java application, then you will need to add these to the build path.

    Right click on the project and select Properties > Build Path > Add External JARs

    Here just add the jdt libraries from the Eclipse plugins directory.