2

UPDATED QUESTION:

I had to import a project from some sources that I had been given. The project complained of missing imports. Therefore, I downloaded the .jar from internet and added them as external jar.

In my Eclipse Indigo Java EE, I added missing .jar file to Java Project by following How to import a jar in Eclipse

The errors in the import statements in the classes disappeared after adding the jar. However, the MANIFEST.MF throws a bundle not resolved error. The MANIFEST.MF file which had existed in the sources had a "Require-Bundle" under which these were listed(perhaps bundled already by them but the bundles weren't given) where the error I get is:

eg: org.apache.commons.configuration;bundle-version="1.7.0"

Bundle 'org.apache.commons.configuration' cannot be resolved

How to resolve this?

Thanks in advance

Community
  • 1
  • 1
user907810
  • 3,208
  • 10
  • 39
  • 47
  • When working with bundles/plugins, you should never update the Build Path directly. Is the jar you want an OSGi bundle already? Is it part of your target platform (for compiling)? – Paul Webster Jun 25 '12 at 11:20
  • My .jar is not an OSGi bundle. I have included in teh Build Path of my Java project. What is OSGi bundle. Why should I convert the .jar to bundle and how? – user907810 Jun 25 '12 at 14:19
  • See http://stackoverflow.com/q/3594024/713646 and http://stackoverflow.com/q/762721/713646 as they explain the relationship between jars and OSGi bundles – Paul Webster Jun 25 '12 at 14:25
  • I think, I have to rephrase a bit. I had to import a project from some sources that I had been given. The project complained of missing imports. Therefore, I downloaded the .jar from internet and added them as external jar. The MANIFEST.MF file which had existed in the sources had a "Require-Bundle" under which these were listed(perhaps bundled already by them but the bundles weren't given). These lines threw the error that I have complained about. Pleas help – user907810 Jun 25 '12 at 14:30
  • Please update your question with that information. – Paul Webster Jun 25 '12 at 14:57

1 Answers1

2

You need to check that the bundle is an OSGi bundle. Expand and look at its MANIFEST.MF. You should be able to get the OSGi version of that bundle from the same place you got the project you are trying to import. Then add that bundle to your Target Platform. See Preferences>Plug-in Development>Target Platform You can edit your active platform or create a new one from a fresh install of eclipse.

Paul Webster
  • 10,614
  • 1
  • 25
  • 32