如何启动osgi控制台(Equinox)



我正在尝试在Windows7中启动一个OSGi控制台。

我在终端窗口上使用了以下语句:

java -jar org.eclipse.osgi.jar -console

但它不起作用,即什么都没有发生,也没有出现提示osgi>。除^C使其重新出现通常的终端提示外,在键盘上打字是无效的。

有人有什么建议吗?

从Equinox 3.8.0.M4开始,它有了一个新的控制台。因此,您还需要这四个捆绑包才能使其正常运行。

  1. org.eclipse.equinox.console.jar
  2. org.apache.felix.gogo.shell.jar
  3. org.apache.felix.gogo.command.jar
  4. org.apache.felix.gogo.runtime.jar

这些jar文件可以在Eclipse安装文件夹的"plugins"文件夹下找到。复制这些罐子,并将它们与org.eclipse.osgi.jar放在同一个文件夹中,它看起来像:

  • somedir/
    • 配置/
      • config.ini
    • org.eclipse.osgi.jar
    • org.eclipse.equinix.console.jar
    • org.apache.filex.gogo.shell.jar
    • org.apache.filex.gogo.command.jar
    • org.apache.filex.gogoo.runtime.jar

然后将config.ini编辑为:

osgi.bundles=org.apache.felix.gogo.runtime@start, org.apache.felix.gogo.command@start, org.apache.felix.gogo.shell@start, org.eclipse.equinox.console@start

完成此操作后,在命令行中运行java -jar org.eclipse.osgi.jar -console,OSGi控制台将启动。

参考错误371101

2022年6月更新:

与此同时,所需捆绑包的列表变得更长:

osgi.bundles= 
    org.apache.felix.gogo.runtime_1.1.4.v20210111-1007.jar@start, 
    org.apache.felix.gogo.command_1.1.2.v20210111-1007.jar@start, 
    org.apache.felix.gogo.shell_1.1.4.v20210111-1007.jar@start, 
    org.eclipse.equinox.console_1.4.500.v20211021-1418.jar@start, 
    org.eclipse.osgi.services_3.10.200.v20210723-0643.jar@start, 
    org.osgi.util.function_1.2.0.202109301733.jar@start, 
    org.osgi.util.promise_1.2.0.202109301733.jar@start, 

请注意,您可以直接在插件文件夹中引用org.eclipse.osgi。如果你这样做,你的配置文件夹就在插件文件夹中!

java -jar pluginsorg.eclipse.osgi_3.18.0.v20220516-2155.jar -console

equinox内置控制台自3.8版本以来已被弃用并禁用。如果使用较新的版本,则应使用osgi.console.enable.builtin=true属性。看见http://hwellmann.blogspot.hu/2012/08/new-osgi-console-in-equinox-380.html.

可以将这些特性设置为系统特性。你的命令是:

java -Dosgi.noshutdown=true -Dosgi.console.enable.builtin=true -jar org.eclipse.osgi.jar -console

这对我3.8起到了作用。我刚刚用3.10试过,但它不起作用。我想内置控制台已经完全删除了。

你应该使用gogo控制台,它已经成为事实上的标准。您可以在上面的链接中找到有关它的信息。

您还可以更改eclipse插件所在的目录,并发出类似于以下命令的命令:

java -Dosgi.bundles=.org.apache.felix.gogo.shell_1.1.0.v20180713-1646.jar@start,.org.apache.felix.gogo.command_1.0.2.v20170914-1324.jar@start,.org.apache.felix.gogo.runtime_1.1.0.v20180713-1646.jar@start,.org.eclipse.equinox.console_1.3.100.v20180827-1235.jar@start -jar org.eclipse.osgi_3.13.100.v20180827-1536.jar -console

这将启动osgi控制台

最新更新