Java 8 OSGI-Java8->;9迁移(需要能力问题)

Java 8 OSGI-Java8->;9迁移(需要能力问题),java-8,osgi,java-9,bndtools,Java 8,Osgi,Java 9,Bndtools,我正在尝试将我们的项目从Java8迁移到Java9。第一次失败后,我已经准备好了基本的项目。但是,我在java版本功能方面遇到了一些问题,例如bellow(只是其中的一部分,但与java版本不同,它们都是相同的): 我做的第一件事是更新所有的依赖项——尽管没有帮助。 我在谷歌上搜索了很多,但只得到了几个链接。 哪一个最接近问题没有帮助思考-我添加了以下行,没有结果: run.bndrun 也许升级我的bnd-gradle插件会有所帮助,但是,mavenCentral中没有提到(4.0)的版本(我

我正在尝试将我们的项目从Java8迁移到Java9。第一次失败后,我已经准备好了基本的项目。但是,我在java版本功能方面遇到了一些问题,例如bellow(只是其中的一部分,但与java版本不同,它们都是相同的):

我做的第一件事是更新所有的依赖项——尽管没有帮助。 我在谷歌上搜索了很多,但只得到了几个链接。 哪一个最接近问题没有帮助思考-我添加了以下行,没有结果:

run.bndrun 也许升级我的bnd-gradle插件会有所帮助,但是,
mavenCentral
中没有提到(4.0)的版本(我目前使用的是3.5)

我的工程规格- 顺便说一句:若你们试图用Intellij运行项目,问题可能会发生——至少我们并没有处理好运行我们的主项目

任何帮助将不胜感激,我会尽我所能提供您更多的信息,如果需要的话

更新 即使我删除了几乎所有的依赖项,在启动
run.bndrun
之后,我只收到


project.main
是我唯一的捆绑包。

Bnd 4.0尚未发布。因此,它目前不在maven central


此外,您还需要确保Felix框架的版本理解Java 9,并且能够正确地提供Java 9 ee。

正如我在中提到的,我们依赖于enroute 2.0,它提供了旧版本的
org.eclipse.osgi
。手动更新到
3.13
后,
Require功能的问题消失了。

1)第一个答案是thx-我是作者。:)2)这可能是原因,但即使是我自己的包也抱怨java 8。。。关于felix-我已经查过了
org.apache.felix.gogo
-至少是很新的。。。但是我找不到任何关于Java9支持的信息。尽管如此,还是要谢谢你的提示。好吧,我发现Karaf正在使用felix,即使他们最近更新了。而且,Karaf正在开发Java9-但总是。。。再说,felix creators说,ie.Eclipse依赖于felix,所以…我说的是felix OSGi框架,而不是felix gogo捆绑包。我在想“你在跟我说什么?”因为我们不依赖于felix osgi
,所以我们使用了中包含的实现,它使用了2015年3.10版中的
org.eclipse.osgi
。我已经更新了手册,至少现在可以工作了。
! Failed to start bundle org.apache.felix.gogo.command-1.0.2, exception 

Could not resolve module: org.apache.felix.gogo.command [12]
  Unresolved requirement: Import-Package: org.apache.felix.service.command; version="[1.0.0,2.0.0)"
    -> Export-Package: org.apache.felix.service.command; bundle-symbolic-name="org.apache.felix.gogo.runtime"; bundle-version="1.0.0"; version="1.0.0"
       org.apache.felix.gogo.runtime [2]
         Unresolved requirement: Import-Package: org.osgi.service.event; version="[1.3.0,2.0.0)"; resolution:="optional"
         Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))"

org.osgi.framework.BundleException: Could not resolve module: org.apache.felix.gogo.command [12]
  Unresolved requirement: Import-Package: org.apache.felix.service.command; version="[1.0.0,2.0.0)"
    -> Export-Package: org.apache.felix.service.command; bundle-symbolic-name="org.apache.felix.gogo.runtime"; bundle-version="1.0.0"; version="1.0.0"
       org.apache.felix.gogo.runtime [2]
         Unresolved requirement: Import-Package: org.osgi.service.event; version="[1.3.0,2.0.0)"; resolution:="optional"
         Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))"
Bundle-RequiredExecutionEnvironment: JavaSE-9
Provide-Capability: 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,9"
Eclipse Oxygen.3a Release (4.7.3a)
Bndtools 3.5.0.REL
Java 9.0.4+11
OSGI 6.0
Gradle 4.4
Gradle bnd plugin - 3.5
could not resolve the bundles: [project.main-1.0.0.201804171613 org.osgi.framework.BundleException: Could not resolve module: project.main [3]
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.8))"

]

Failed to start bundle project.main-1.0.0.201804171613, exception Could not resolve module: project.main [3]
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.8))"