java.lang.NoClassDefFoundError while using SWT Add-on (AutocompleteComboInput)

谁说我不能喝 提交于 2019-12-13 21:01:21

问题


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

However, I am getting a NoClassDefFoundError. As I have read, it seems a class is not found during runtime.

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.


回答1:


I have found the solution to this problem.

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


来源:https://stackoverflow.com/questions/22854005/java-lang-noclassdeffounderror-while-using-swt-add-on-autocompletecomboinput

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!