1

I developed an eclipse plugin and I'm trying to install it on another instance of eclipse. When I run/debug my plugin as an eclipse application everything works correctly. The problem occurs only after I install the plugin through the update site I created.

I created a very simple update site which includes a single feature with my plugin packaged in it. After installing using the update site I can see my plugin in the plugin directory under the eclipse install dir and it correctly contains all the data that should be in there (I think). However, when I instantiate the plugin (by hitting the key-binding I defined) I get a ClassNotFoundException for the main plugin class, one that I created and that can be found in the bin directory of my plugin.

It seems that the bin directory is somehow not recognized as a place to search for classes, but I assume that it should be added to the eclipse classpath as part of the plugin installation.

I googled quite a bit about this and found many related problems, none of which was quite hitting my specific situation. I would appreciate any suggestion!

Dana
  • 2,619
  • 5
  • 31
  • 45
  • How are you defining the key binding? Is this in the plugin.xml or somewhere else? – greg-449 Sep 06 '13 at 09:13
  • Yes, I'm defining it through the plugin.xml. There are some details about it here: http://stackoverflow.com/questions/18519534/key-binding-for-a-custom-eclipse-content-assist/18601197#18601197 – Dana Sep 06 '13 at 13:20
  • Have you added the package containing the `javaCompletionProposalComputer` to the `Export-Package` list in the `MANIFEST.MF` so that the jdt plugin can find it? – greg-449 Sep 06 '13 at 13:33
  • I'm not sure what you mean by that. Do I need to create a package/jar with the class files? They are already there under the `bin` directory of the plugin. I assumed that this is where eclipse would search for them. – Dana Sep 06 '13 at 13:52

1 Answers1

2

When you create a plugin other plugins can only access the classes in packages declared in the Export-Package section of the Manifest.mf. Open the plugin.xml editor and look at the 'Runtime' tab - it needs to have your package listed. Something like this:

enter image description here

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • 2
    Thanks. In my case things look slightly different than in your screenshot, but I basically had to add my `bin` directory to the runtime classpath. Pretty strange that this isn't being done by default, but hey, at least it's working now :) – Dana Sep 06 '13 at 14:26