Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Mars : The import org.osgi cannot be resolved

I'm using Eclipse Mars (latest version) to create an OSGI bundle with an Activator class. For this, I'm using the Plug-In Project selecting "OSGI framework" to "standard" (but if I select "Equinox" I had same result) on creation. The Activator class is empty for now but the compiler already raises me following errors :

The import org.osgi cannot be resolved BundleActivator cannot be resolved to a type BundleContext cannot be resolved to a type

Why ?

Thanks, Paolo.

like image 690
ppatierno Avatar asked Dec 08 '15 14:12

ppatierno


2 Answers

Finally I solved.

The target platform wasn't selected.

Paolo.

like image 161
ppatierno Avatar answered Sep 26 '22 17:09

ppatierno


To fix this, i have added the dependencies in the manifest file of the project

Go to META-INF Folder in your project where your are getting the error --> MANIFEST.MF --> Dependencies --> Required Plugins --> Search and Add all the OSGI Plugins there and save it

like image 42
Kiran Vedantam Avatar answered Sep 22 '22 17:09

Kiran Vedantam