尝试从eclipse中运行我的eclipse插件,我收到错误信息到控制台,这使得嵌套的eclipse无法运行插件:
org.osgi.framework.BundleException: Error starting module.
at org.eclipse.osgi.container.Module.doStart(Module.java:590)
...
Caused by: java.lang.Error: Unresolved compilation problems:
The import org.eclipse cannot be resolved
The import org.eclipse cannot be resolved
The import org.eclipse cannot be resolved
The import org.eclipse cannot be resolved
The import org.osgi cannot be resolved
AbstractUIPlugin cannot be resolved to a type
IStartup cannot be resolved to a type
The method earlyStartup() of type Plugin must override or implement a supertype method
BundleContext cannot be resolved to a type
BundleContext cannot be resolved to a type
建议我的插件有编译错误,但是:
答案 0 :(得分:0)
确实没有编译错误:问题出在其他地方。主要的 插件类是一个单例,它实现如下:
public class Plugin extends AbstractUIPlugin implements IStartup {
public static Plugin plugin;
/ ** an empty c'tor. creates an instance of the plugin. */
public Plugin() {
plugin = this;
}
....
}
现在,其他类指的是这个public
字段,它没有初始化;由于某种原因,eclipse认为这是一个汇编
错误。它不是。使用该领域的吸气剂解决了这个问题。