Plugins 使工作的EclipseJDT插件适应EclipseC++;

Plugins 使工作的EclipseJDT插件适应EclipseC++;,plugins,eclipse-plugin,eclipse-cdt,Plugins,Eclipse Plugin,Eclipse Cdt,我已经为Eclipse开发了插件。它包括属性页、若干操作和特定视图。所有这些功能都通过特定的扩展点添加: <page class="MyPropertyPage" id="MyPage1" name="My Project" nameFilter="*" selectionFilter="single"> <enabledWhen> <instanceof

我已经为Eclipse开发了插件。它包括属性页、若干操作和特定视图。所有这些功能都通过特定的扩展点添加:

  <page
        class="MyPropertyPage"
        id="MyPage1"
        name="My Project"
        nameFilter="*"
        selectionFilter="single">
     <enabledWhen>
        <instanceof
             value="org.eclipse.core.resources.IProject">
        </instanceof> 
     </enabledWhen>   
  </page>           
  <page
        class="MyPropertyPage"
        id="MyPage2"
        name="My Project"
        nameFilter="*"
        selectionFilter="single">
     <enabledWhen>
        <instanceof
             value="org.eclipse.cdt.internal.core.model.CProject">
        </instanceof>                                 
     </enabledWhen>
  </page>
在调试模式下,当第二个Eclipse用C++透视图打开时,它运行良好。但是在运行时,它失败了,出现错误
java.lang.NoClassDefFoundError:org/eclipse/cdt/internal/ui/cview/cview

执行my action命令的尝试也失败,出现类似错误
java.lang.NoClassDefFoundError:org/eclipse/cdt/internal/core/model/TranslationUnit

有助于克服错误吗?
非常感谢。

您是否正确设置了插件的依赖项(plugin.xml属性编辑器中的“依赖项”选项卡)?我猜应该是org.eclipse.cdt.ui.org.eclipse.cdt.ui被添加到依赖项中。可能订单很重要吗?这是最后一次,我不知道。试着向上移动它。顺便说一句:当你的插件失败时,你如何安装/运行它?我只是将它复制到插件文件夹中。它工作,不是吗?即使对于Eclipse C++,我的属性页也适用于导航器视图和命令运行。对于Project Explorer和C/C++项目视图,插件失败,出现NoClassDefFoundError异常。。。
if (obj instanceof IJavaProject) {
     ...
} else if (obj instanceof CompilationUnit) {
         ...
} else if (obj instanceof TranslationUnit) {
     ...                            
}