当前位置: 首页 > 知识库问答 >
问题:

无法使用Tycho和Java9构建Eclipse RCP项目

祁鸿晖
2023-03-14
[INFO] Scanning for projects...
[WARNING] Could not start bundle org.eclipse.equinox.registry
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.registry [42]
  Unresolved requirement: Require-Bundle: org.eclipse.equinox.common; bundle-version="[3.7.0,4.0.0)"
    -> Bundle-SymbolicName: org.eclipse.equinox.common; bundle-version="3.8.0.v20160315-1450"; singleton:="true"
       org.eclipse.equinox.common [18]
         Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))"
  Unresolved requirement: Import-Package: org.eclipse.core.runtime.jobs; resolution:="optional"
    -> Export-Package: org.eclipse.core.runtime.jobs; bundle-symbolic-name="org.eclipse.core.jobs"; bundle-version="3.8.0.v20160209-0147"; version="0.0.0"
       org.eclipse.core.jobs [6]
         Unresolved requirement: Require-Bundle: org.eclipse.equinox.common; bundle-version="[3.8.0,4.0.0)"
           -> Bundle-SymbolicName: org.eclipse.equinox.common; bundle-version="3.8.0.v20160315-1450"; singleton:="true"

    at org.eclipse.osgi.container.Module.start(Module.java:434)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:392)
    at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.tryActivateBundle(DefaultEquinoxEmbedder.java:215)
    at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.activateBundlesInWorkingOrder(DefaultEquinoxEmbedder.java:207)
    at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.doStart(DefaultEquinoxEmbedder.java:182)
    at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.start(DefaultEquinoxEmbedder.java:67)
    at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.checkStarted(DefaultEquinoxEmbedder.java:310)
    at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:286)
    at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:280)
    at org.eclipse.tycho.p2.resolver.P2DependencyResolver.initialize(P2DependencyResolver.java:428)
    at org.eclipse.sisu.plexus.PlexusLifecycleManager.initialize(PlexusLifecycleManager.java:303)
    at org.eclipse.sisu.plexus.PlexusLifecycleManager.activate(PlexusLifecycleManager.java:207)
    at org.eclipse.sisu.bean.BeanScheduler.schedule(BeanScheduler.java:151)
    at org.eclipse.sisu.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:147)
    at org.eclipse.sisu.plexus.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:72)
    at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:119)
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:115)
    at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
    at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:89)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:87)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
    at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
    at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
    at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
    at org.eclipse.tycho.core.resolver.DefaultDependencyResolverFactory.lookupDependencyResolver(DefaultDependencyResolverFactory.java:74)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.setupProject(DefaultTychoResolver.java:95)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:90)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:267)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:563)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

我将Tycho版本从0.25.0升级到1.1.0。现在,构建开始时很好,但后来失败了,出现了数百个错误,如:

... Compilation failure:
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

共有1个答案

顾穆冉
2023-03-14

这可能是因为在运行时/调试期间没有几个插件/包。请访问您的项目“运行配置..”并转到插件选项卡。启用以下插件

 1. org.eclipse.equinox.ds
 2. org.eclipse.team.core
 3. org.eclipse.ui.trace
 4. org.eclipse.equinox.util
 5. org.eclipse.equinox.common 

然后单击右侧出现的“Add Required Plug-ins”按钮,并再次单击ApplyRun应用程序。

类似的bug已经在eclipse中报告过。你也可以参考这个。

 类似资料:
  • 不管怎样,现在这个构建由于这个错误而失败,我不知道如何解决它: 错误:package some.package.impl不存在 导入一些。package.impl.roundaboutimpl; 提前感谢!

  • 我已经为一个项目配置了SVN-Jenkins-Maven-Tomcat。小项目的每件事都很好。但当我试图构建包含大量JAR和包的实际项目时…它显示错误..找不到xxx包。我已经手动将依赖项JAR添加到本地maven存储库中。

  • 这是用Gradle构建Kotlin+Java9项目的后续。在链接后使用Groovy的Gradle。在我的情况下,使用Kotlin DSL。 基本上我有一个梯度项目与以下结构(只有相关的内容在这里): 问题:如何让链接的post(或任何其他解决方案)中提供的解决方案运行,以便使用Java9/10环境编译带有Gradle的Kotlin DSL的Kotlin项目?

  • ./mvnw和mvn clean install在添加lombok依赖项时失败,但从Intellij IDE启动时成功运行。发现以下错误: 这是POJO

  • 由于butterknife依赖的错误,我无法构建android项目。 错误 任务': app: javaPreCompileDebug'执行失败。 无法解析配置的所有文件: app: dedegAnnotationProcessorClasspath。转换butterknife-compiler-8.6.0.jar失败(com.jakewharton:巴特切夫-编译器: 8.6.0)以匹配属性{a

  • 值得说的是,当我在Eclipse内部运行单元测试时(而不是在Maven中),它是有效的。 这是我测试片段中的第谷配置: 正如这里所建议的,我将这个特性作为一个依赖项添加,因为我的测试片段除了它的主机之外还需要一些其他的包,所以我希望这能起作用。