I wrote an eclipse plugin which should be executed at startup of workspace (see Executing eclipse plugin automatically). It works perfectly when I try it out with the Run button. But now I created an update site and installed the plugin via the update manager. I don't know why but now it is not executed when eclipse workspace starts.
What could be the problem here?
Content of plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension point="org.eclipse.ui.startup">
<startup class="plugin.first.handlers.StartClass"/>
</extension>
</plugin>
I found some additional info in /workspace/.metadata/.log:
!SESSION 2014年02月10日 14:17:08.358 -----------------------------------------------
eclipse.buildId=4.3.0.M20130911-1000
java.version=1.7.0_02
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Command-line arguments: -os win32 -ws win32 -arch x86_64
!ENTRY org.eclipse.ui.workbench 4 2 2014年02月10日 14:17:21.380
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
at plugin.first.handlers.ClearFolder.doClear(ClearFolder.java:12)
at plugin.first.handlers.StartClass.earlyStartup(StartClass.java:15)
at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:87)
at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:66)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.Workbench55ドル.run(Workbench.java:2551)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils cannot be found by plugin.clearsvnauth_1.0.0.201402101022
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
!ENTRY org.eclipse.ui 4 4 2014年02月10日 14:17:21.393
!MESSAGE Unhandled Exception
!ENTRY plugin.clearsvnauth 4 0 2014年02月10日 14:17:21.394
!MESSAGE Unable to execute early startup code for an extension
!STACK 0
java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
at plugin.first.handlers.ClearFolder.doClear(ClearFolder.java:12)
at plugin.first.handlers.StartClass.earlyStartup(StartClass.java:15)
at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:87)
at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:66)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.Workbench55ドル.run(Workbench.java:2551)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils cannot be found by plugin.clearsvnauth_1.0.0.201402101022
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
Why do I get java.lang.NoClassDefFoundError?
1 Answer 1
I found the solution myself. You need to add jars you used in your project to your build configuration (see attached picture).
Build Configuration
plugin.xmlis included in the code.plugin.xmlis included in the project. I have posted its content in my question.workspace/.metadata/log? How about the content of the installed plugin, is it complete?