我在eclipse中有一個插件,它是完美的工作。 現在我必須實現無頭插件功能。java.lang.NoClassDefFoundError:org/eclipse/ui/plugin/AbstractUIPlugin
添加以下代碼plugin.xml中
<extension
id="id1"
point="org.eclipse.core.runtime.applications">
<application>
<run
class="de.**.HeadlessPlugin">
</run>
</application>
然後創建下面的類 「HeadlessPlugin」
package de.tsystems.together.mqc.impl;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IExecutableExtensionFactory;
import org.eclipse.core.runtime.IPlatformRunnable;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
public class HeadlessPlugin implements IExecutableExtensionFactory {
public HeadlessPlugin()
{
}
public Object create() throws CoreException {
System.out.println("Hello world");
return null;
}
}
我正確導出插件和安裝在同一一個新的eclipse實例。 然後我試着通過CMD啓動插件:
java -jar "plugins/org.ecplise.equinox.launcher_1.1.1.R36x_v20101122_1400.jar" org.eclipse.core.launcher.Main -application de.***.id1
經過這次日食發生錯誤:
org.eclipse.core.runtime.CoreException:插件德。 *無法加載課程。* .HeadlessPlugin。
有沒有人有想法?
堆棧跟蹤:
!ENTRY org.eclipse.osgi 4 0 2013-08-19 14:15:47.344
!MESSAGE Application error
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in de.** was unable to load class de.**.HeadlessPlugin.
...
Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle de.** (1522).
...
Caused by: org.osgi.framework.BundleException: The activator de.**.Plugin for bundle de.** is invalid
...
Caused by: java.lang.NoClassDefFoundError: org/eclipse/ui/plugin/AbstractUIPlugin
爲什麼Eclipse無法加載'de。*。HeadlessPlugin'類? –
這就是我的問題... –
請發佈堆棧跟蹤。 –