解决Eclipse进行OSGI调试时出现Could not find bundle: org.eclipse.equinox.console的问题

本文介绍了解决 Eclipse 下 OSGi 开发过程中出现的 Could not find bundle: org.eclipse.equinox.console 错误的方法。通过将 Apache Felix Gogo 相关的四个依赖包添加到 Run Configuration 中解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

故障现象

Eclipse下OSGi开发,运行测试时,程序直接报错,堆栈信息显示:Could not find bundle: org.eclipse.equinox.console

解决办法

参考资料 : stackoverflow

This is because the default shell of Eclipse has been moved to “Apache Felix Gogo”; so the necessary bundles must be added to the “Run Configuration” before running. Followings are the four bundled that you need to select from the list:
- org.apache.felix.gogo.command_0.10.0v.jar
- org.apache.felix.gogo.runtime_0.10.0v.jar
- org.apache.felix.gogo.shell_0.10.0v.jar
- org.eclipse.equinox.console_1.0.100.jar

Bundle settings in osgi develop

解释说明:
根据 stackoverflow 上的解释是:Eclipse下默认的shell已经迁移到“Apache Felix Gogo”之下,所以在OSGi开发时的bundles在执行时,必须在“Run Configuration”中添加必要的依赖bundles,以下4项是必须的:

  • org.apache.felix.gogo.command_0.10.0v.jar
  • org.apache.felix.gogo.runtime_0.10.0v.jar
  • org.apache.felix.gogo.shell_0.10.0v.jar
  • org.eclipse.equinox.console_1.0.100.jar

所以,“Run Configuration”–> “Bundles” –> “Target Platform” –> 勾选以上4个依赖bundles
就OK了

!SESSION 2025-08-11 13:41:01.459 ----------------------------------------------- eclipse.buildId=unknown java.version=1.8.0_172 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86 -clean !ENTRY org.eclipse.platform 2 0 2025-08-11 13:41:02.540 !MESSAGE Could not resolve module: org.eclipse.platform [204] Unresolved requirement: Require-Bundle: org.eclipse.ui.intro; bundle-version="[3.2.0,4.0.0)" !ENTRY org.eclipse.osgi 4 0 2025-08-11 13:41:02.540 !MESSAGE Application error !STACK 1 java.lang.NullPointerException at com.ami.veb.ui.VeBApplication.checkInstanceLocation(VeBApplication.java:493) at com.ami.veb.ui.VeBApplication.start(VeBApplication.java:280) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
最新发布
08-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值