org.osgi.framework.BundleException: 無法找到 bundle: org.eclipse.equinox.console

2022-09-01 19:57:28

命令:

\eclipse-SDK-4.2RC3-win32-x86_64_001\eclipse\plugins>java -jar org.eclipse.osgi_3.8.0.v20120529-1548.jar -console

异常(来自日志文件)

!SESSION 2012-06-22 23:36:27.649 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_25
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments:  -console

!ENTRY org.eclipse.osgi 4 0 2012-06-22 23:36:28.632
!MESSAGE Could not find bundle: org.eclipse.equinox.console
!STACK 0
org.osgi.framework.BundleException: Could not find bundle: org.eclipse.equinox.console
    at org.eclipse.osgi.framework.internal.core.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:211)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:297)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:151)

!ENTRY org.eclipse.osgi 4 0 2012-06-22 23:36:28.663
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:151)

但是下面的罐子是可用的。

org.eclipse.equinox.console_1.0.0.v20120522-1841.jar

对上述错误有什么建议吗?


答案 1

您需要安装几个捆绑包才能使用控制台,如果您仅使用Equinox,则不会获得这些捆绑包。java -jar ...

实现此目的的最快方法是创建一个以以下内容命名的文件:configuration/config.ini

osgi.bundles=file\:org.eclipse.equinox.console_1.0.0.v20111215-1210.jar@start,file:\org.apache.felix.gogo.runtime_0.8.0.v201108120515.jar@start,file:\org.apache.felix.gogo.shell_0.8.0.v201110170705.jar@start

注意,您必须根据实际拥有的版本号查看这些捆绑包的版本号。我用SDK-4.2M6尝试了这个,其中一些可能在RC3中发生了变化。


答案 2

在新版本的Equinox中,内置的OSGi shell已被替换为felix gogo shell。如果你想使用新的shell,你必须放置gogo jars,并在你的配置文件中定义它们。

但是,如果您喜欢OSGi Equinox shell,则只需将以下行添加到文件中即可使用它: .在这种情况下,无需添加额外的 jar 或任何配置。config.iniosgi.console.enable.builtin=true


推荐