问题描述
我正在尝试使用自动完成组合输入.我添加了 net.sf.swtaddons_0.1.1_bin_src .jar 通过添加外部JAR"添加到库中.
I am trying to implement an autocomplete Combo in SWT using AutocompleteComboInput. I have added net.sf.swtaddons_0.1.1_bin_src.jar to the library via "Add External JAR".
import net.sf.swtaddons.autocomplete.combo.AutocompleteComboInput;
...
subjectCodeCombo = new Combo(tab3Composite, SWT.DROP_DOWN);
// other code modifying Combo appearance here...
// returns a String[] of items retrieved from database
String[] subjectCodeArray = dbQuery.subjectsToArray();
subjectCodeCombo.setItems(subjectCodeArray);
subjectCodeCombo.setText("- SELECT -");
new AutocompleteComboInput(subjectCodeCombo); // throws an error
但是,我得到一个NoClassDefFoundError
.如我所读,似乎在运行时未找到类.
However, I am getting a NoClassDefFoundError
. As I have read, it seems a class is not found during runtime.
我相信我需要对运行时类路径"做一些事情,但是我迷路了.赞赏如何在Eclipse IDE中解决此问题的步骤.
I believe I need to do something about the "runtime classpath", but I am lost. Steps on how to resolve this in Eclipse IDE is appreciated.
推荐答案
我已经找到了解决此问题的方法.
I have found the solution to this problem.
除了net.sf.swtaddons_0.1.1_bin_src.jar
之外,还需要将其他3个JAR添加到库中:
Apart from net.sf.swtaddons_0.1.1_bin_src.jar
, 3 other JARs were still needed to be added to the Library:
- eclipse-equinox-common-3.5.0.jar
- org.eclipse.core.commands.jar
- org.eclipse.jface-3.6.0.jar
这篇关于使用SWT附加组件时出现java.lang.NoClassDefFoundError(AutocompleteComboInput)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!