views:

170

answers:

1

I have an Eclipse plugin project, and it depends on other projects that I have in my Eclipse workspace. After adding the project dependencies under "Java Build Path" -> "Projects" tab, and also selecting the project in the "Order and Export" I get a java.lang.NoClassDefFoundError.

I'm assuming that the other projects have not been properly included into the plugin. Does anyone know how to fix this?

Thanks, James

+1  A: 

An Eclipse plug in project manages dependencies differently than a regular Java project.

I'm assuming that you're adding packages with .class files.

On the Project -> Build Path, add the binary packages from the other projects to the Libraries

Open up the MANIFEST.MF file under the META-INF directory. You'll see a formatted editor with 8 tabs on the bottom.

Click on the Dependencies tab, and add the other Java projects in the Imported Packages dialog. You have to check the box labeled "Show non-exported packages". If your other Java projects are Eclipse plug ins, add them under Required Plug-ins instead.

Gilbert Le Blanc
I tried adding packages in the "Imported Packages" section, but I can't find the packages in my other project in the "Package Selection" dialog. Is there something I need to do before this?
James
Sorry, it's been a while since I've created a new Eclipse plug in project. I've updated my answer with more instructions.
Gilbert Le Blanc