jface编程报错java.lang.NoSuchMethodError: org.eclipse.jface.util.Util.isMac()Z

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jface编程报错java.lang.NoSuchMethodError: org.eclipse.jface.util.Util.isMac()Z相关的知识,希望对你有一定的参考价值。

错误信息:
Exception in thread "main" java.lang.NoSuchMethodError: org.eclipse.jface.util.Util.isMac()Z
at org.eclipse.jface.text.source.VerticalRuler.<clinit>(VerticalRuler.java:95)
at Editor.createContents(Editor.java:45)
at org.eclipse.jface.window.Window.create(Window.java:426)
at org.eclipse.jface.window.Window.open(Window.java:785)
at EditorTestDrive.main(EditorTestDrive.java:11)

部分源码:
protected Control createContents(Composite parent) Composite top = new Composite(parent,SWT.NONE);
top.setLayout(new FillLayout());
document = new PersistentDocument();
viewer = new SourceViewer(top,new VerticalRuler(10),SWT.V_SCROLL|SWT.H_SCROLL); //Editor类中 第45行代码
configuration = new JSEditorConfiguration(this);
viewer.configure(configuration);
viewer.setDocument(document);
undoManager = new DefaultUndoManager(100);
undoManager.connect(viewer);
initCodeFont();
return parent;


求问解决办法,是jar包冲突了?还是什么原因?

参考技术A 出现这个问题的原因有不少:
1. 在引包是引用了不匹配的包版本
2. 开发环境和运行环境的不一致
3. 更新程序的时候,由于函数更新输出的数据格式跟原来的不一致,从而导致这个问题。本回答被提问者和网友采纳

以上是关于jface编程报错java.lang.NoSuchMethodError: org.eclipse.jface.util.Util.isMac()Z的主要内容,如果未能解决你的问题,请参考以下文章

SWT(JFace) Wizard(Eclipse插件编程必备)

eclipse启动报错 Problems occurred when invoking code from plug-in: "org.eclipse.jface"

jface中文是啥意思

JFace和SWT有啥区别

SWT/JFace问题:如何在单元格中只显示图片

问问企业Java开发者,java语言的各种界面编程组件:swing、awt、swt、jsf、jface都用哪种比较多,如果有高