Java 8 和缺少所需的能力Require-Capability:osgi.ee;过滤器=“(&(osgi.ee=JavaSE)(版本=1.8))"
我使用的是运行 Java 8 的 Eclipse Luna win32.x86_64.
I have using Eclipse Luna win32.x86_64 runing with Java 8.
从 Help Menu >关于 >安装细节 >配置选项卡
:
java.runtime.version=1.8.0_05-b13
java.version=1.8.0_05
我创建了新的插件项目,请求 JavaSE-1.8
作为执行环境:
I have created new plug-in project, requesting JavaSE-1.8
as Execution Environment:
在 myplugin/META-INF/MANIFEST.MF
文件中我当然有:
In the myplugin/META-INF/MANIFEST.MF
file I have of course:
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
我在产品文件中使用这个插件.当我尝试验证它时,我收到以下错误:
I use this plugin in a product file. When I try to validate it, I get following error:
当然,如果我启动产品,我会得到:
Of course if I start the product, I get:
!ENTRY org.eclipse.osgi 2 0 2014-07-10 08:14:22.042
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2014-07-10 08:14:22.043
!MESSAGE Bundle update@********/myplugin/ was not resolved.
!SUBENTRY 2 myplugin 2 0 2014-07-10 08:14:22.044
!MESSAGE Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
<小时>
我尝试了很多验证:
I have tried to verify a lot:
首选项 > Java > 已安装的 JRE
首选项 > Java > 已安装的 JRE > 执行环境
首选项 > Java > 编译器:JDK Compliance Compiler 合规级别
当我启动产品时,我在 Launching 选项卡中检查了我使用 jre8 作为执行环境.
When I start the product, I checked in the Launching tab that I use the jre8 as execution environment.
我什至尝试在 Run Configurations
对话框中更改 Java Runtime Environment
:
I have even tried to change the Java Runtime Environment
in the Run Configurations
Dialog:
我尝试了不同的设置.它们都不起作用.
I have tried different settings. None of them works.
怎么了?
这是一个已知问题吗?
推荐答案
这个错误意味着你的bundle有一个Require-Capability: osgi.ee;filter="(&(osgi.ee=JavaSE)(version=1.8))"
条目.所以这意味着只有在有提供此功能的包时才会启动包.
The error means that your bundle has a Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))"
entry in its manifest. So this means the bundle will only start when there is a bundle that provides this capability.
对于 osgi.ee 功能,应该由 OSGi 框架(Equinox)提供此功能.显然它没有这样做.
In case of the osgi.ee capability it is the OSGi framework (equinox) that should provide this capability. Apparently it does not do this.
因此,一种方法是从捆绑清单中删除标头.另一个是让Equinox导出能力.也许您可以简单地尝试使用最新的春分版本.不确定这是否有帮助.您还可以尝试设置框架属性(使用 -D):org.osgi.framework.system.capabilities=osgi.ee;osgi.ee="JavaSE";version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8"
So one approach would be to remove the header from you bundle Manifest. The other would be to make equinox export the capability. Perhaps you could simply try with the newest equinox version. Not sure if this helps though. You could also try to set the framework property (using -D): org.osgi.framework.system.capabilities=osgi.ee; osgi.ee="JavaSE";version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8"
见
- eclipse列表上同样的问题
相关文章