i have a plugin in eclipse, which is work perfect. Now i have to implement headless plugin functionality.
I added the following code in plugin.xml
<extension
id="id1"
point="org.eclipse.core.runtime.applications">
<application>
<run
class="de.**.HeadlessPlugin">
</run>
</application>
Then i created the following class "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;
}
}
I exported the plugin correctly and installed the same in a new eclipse instance. Then i try to start the plugin via cmd:
java -jar "plugins/org.ecplise.equinox.launcher_1.1.1.R36x_v20101122_1400.jar" org.eclipse.core.launcher.Main -application de.***.id1
After this eclipse occured an error:
org.eclipse.core.runtime.CoreException: Plug-in de.* was unable to load class de.*.HeadlessPlugin.
Have anyone an idea??
Stack trace:
!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
de.*.HeadlessPlugin
? – Aaron Digulla