Eclipse plugin plugin stuck in initial state

I used Eclipse to create a new plug-in project, which Activator created for me by default. When debugging (it works like an Eclipse application), I noticed that the start() and stop() methods of this activator were not called.

Following the guide on what to do when your package doesn't appear in Eclipse , I came across the following results.

  • Using the ss command, I see that my list is listed.
  • My package status is Starting '

The package is in the process of launching. The bunch is in STARTING when its start method is active. The bundle must be in this state when the bundle BundleActivator.start(BundleContext) called. If the BundleActivator.start method exits without exception, then the package has worked successfully and should transition to the ACTIVE state.

The breakpoint placed on the first line in the start method does not fall. Nor does System.out.println appear in the console. What could cause the start method to not be called, and therefore the state is stuck in STARTING ?

+4
source share
1 answer

The fact that the OSGi console reports that the plug-in is STARTING not discussed below, but it is the approach by which I got my plug-in to start immediately after starting Eclipse.

As Chris Gerken points out in the commentary , the startup code only runs when trying to use one of the plugin extensions.

Using the org.eclipse.ui.startup extension, you can register a plugin that wants to be activated at startup. This can be configured using the manifest editor.

  • Add org.eclipse.ui as a dependency in the Dependencies tab.
  • On the Extensions tab, add a launch extension ( org.eclipse.ui.startup ).
  • Under "Extension Element Details", a class is provided that implements org.eclipse.ui.IStartup .

startup extension

TaskManager.java

 public class TaskManager implements IStartup { @Override public void earlyStartup() { // This will get called when Eclipse is started, // after the GUI has been initialized. } } 
+2
source

All Articles