1

I've already a java project (non-plugin) for customized logging feature which is internally using log4j. I want to use this customized logger with eclipse plugin-project so I've specified logger project in the build path of the plugin-project. It doesn't give any compilation problem when I try to run the plugin application it gives ClassNotFoundException.

Can anyone tell me the proper way of using non-plugin project with plugin project? Any suggestion would be appreciated.

Thanks & Regards.

jmj
  • 237,923
  • 42
  • 401
  • 438
SmartSolution
  • 2,320
  • 5
  • 37
  • 49

2 Answers2

4

Eclipse is OSGi based, and all plugins are OSGi bundles. The trick is, bundles can usually only see other bundles. You have a couple of options:

  1. turn your other jar into a bundle. You just need to add an OSGi MANIFEST.MF to it. This is the recommended way, as that jar knows what it should and shouldn't do
  2. include that jar in your bundle, and add it to your Bundle-ClassPath. You have to take care on what packages you export and at what version level, because you don't want to ever collide with another bundle.
Paul Webster
  • 10,614
  • 1
  • 25
  • 32
2

You can convert your jar into OSGi bundle as Paul Webster has suggested. You may have a look at my answer to this question How to convert jar to OSGi bundle which some people found useful.

Community
  • 1
  • 1
Kuldeep Jain
  • 8,409
  • 8
  • 48
  • 73