Eclipse Mars: org.osgi import cannot be allowed

I use Eclipse Mars (latest version) to create an OSGI package with the Activator class. To do this, I use the Plug-In project, selecting "OSGI framework" in "standard" (but if I select "Equinox", I had the same result) when creating. The Activator class is empty, but the compiler is already causing the following errors:

Impossible to import org.osgi BundleActivator cannot be allowed for type BundleContext cannot be allowed for type

Why?

Thanks Paolo.

+5
source share
2 answers

Finally, I decided.

The target platform has not been selected.

Paolo

+5
source

To fix this, I added dependencies in the project manifest file

Go to the META-INF folder in your project, where you get the error message → MANIFEST.MF → Dependencies → Required plugins → Search and add all OSGI plugins there and save

0
source

Source: https://habr.com/ru/post/1237661/


All Articles