[英]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. 我正在使用Eclipse Mars(最新版本)来创建一个带有Activator类的OSGI包。 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.
为此,我正在使用插件项目选择“OSGI框架”到“标准”(但如果我在创建时选择“Equinox”我有相同的结果)。 The Activator class is empty for now but the compiler already raises me following errors :
Activator类现在是空的,但编译器已经引发了以下错误:
The import org.osgi cannot be resolved BundleActivator cannot be resolved to a type BundleContext cannot be resolved to a type 导入org.osgi无法解析BundleActivator无法解析为类型BundleContext无法解析为类型
Why ? 为什么?
Thanks, Paolo. 谢谢,保罗。
Finally I solved. 终于我解决了。
The target platform wasn't selected. 未选择目标平台。
Paolo. 保罗。
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 转到项目中的META-INF文件夹,您将收到错误 - > MANIFEST.MF - >依赖项 - >必需的插件 - >搜索并添加所有OSGI插件并保存
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.