我想用我的插件开发draw2d。现在,我只有在我的代码是:java.lang.NoClassDefFoundError:org/eclipse/draw2d/LightweightSystem尽管它被添加
import org.eclipse.draw2d.LightweightSystem;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.*;
public class GraphView extends ViewPart {
public GraphView() {
}
@Override
public void createPartControl(Composite parent) {
//use LightweightSystem to create the bridge between SWT and draw2D
final LightweightSystem lws = new LightweightSystem(new Canvas(parent, SWT.NONE));
}
@Override
public void setFocus() {
// TODO Auto-generated method stub
}
}
我得到org.eclipse.e4.core.di.InjectionException:java.lang.NoClassDefFoundError:组织/日蚀/ Draw2D的/ LightweightSystem当我启动我的eclipse应用程序。我把org.eclipse.draw2d作为外部jar添加到我的项目中。
有人可以帮助我吗?提前致谢!
谢谢˚F或给我一个提示。其实,这里是我找到的解决方案: 当我收到错误时,Manifest.mf中的“必需包”文件看起来像这样: **需要包:org.eclipse.ui, org.eclipse.core。运行时** 我将它改为:** Require-Bundle:org.eclipse.core.runtime, org.eclipse.ui, org.eclipse.draw2d, org.csstudio.swt.widgets; bundle-version =“2.0.1”; resolution:=可选, org.csstudio.swt.xygraph; bundle-version =“2.0.1”; resolution:=可选** 修正了它! 谢谢 – user2033666