【问题标题】:Start Equinox from Windows prompt从 Windows 提示符启动 Equinox
【发布时间】:2015-06-29 10:12:51
【问题描述】:

我想启动最新的 Equinox 框架,但我卡住了。我下载了最新版本并尝试在windows提示符下执行命令:

C:\equinox\plugins>java -jar org.eclipse.osgi_3.10.100.v20150529-1857.jar -console

但是什么也没发生。你知道我如何启动框架吗?

编辑

我下载了launchers-win32.win32.x86_64.Mars.zip

C:\equin\eclipse\plugins>java -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dosgi.console.enable.builtin=true -jar org.eclipse.equinox.la
uncher_1.3.100.v20150511-1540.jar -console
An error has occurred.  See the log file
c:\equin\eclipse\configuration\1435578389939.log

C:\equin\eclipse\plugins>

在错误日志中我得到这个:

!SESSION Mon Jun 29 14:44:18 IDT 2015 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2015-06-29 14:44:18.529
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.RuntimeException: Could not find framework
    at org.eclipse.equinox.launcher.Main.getBootPath(Main.java:1025)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1488)

看起来启动独立 Equinox 非常棘手。

【问题讨论】:

    标签: osgi equinox


    【解决方案1】:

    很遗憾,内置控制台似乎在 Equinox 3.10 中被删除,因此 osgi.console.enable.builtin=true 系统属性将不起作用。当有人想用控制台快速启动 Equinox 时,它很有用,而不需要添加更多的包。

    要使用 gogo shell,有很多教程。简而言之:

    下载以下工件(它们位于 Equinox Mars 的 zip 中):

    • org.eclipse.equinox.console_1.1.100.v20141023-1406.jar
    • org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar
    • org.apache.felix.gogo.shell_0.10.0.v201212101605.jar
    • org.apache.felix.gogo.command_0.10.0.v201209301215.jar

    运行命令:

    java -Declipse.ignoreApp=true -Dosgi.bundles=reference:file:org.eclipse.equinox.console_1.1.100.v20141023-1406.jar@start,reference:file:org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar@start,org.apache.felix.gogo.shell_0.10.0.v201212101605.jar@start,org.apache.felix.gogo.command_0.10.0.v201209301215.jar@start -jar org.eclipse.osgi_3.10.100.v20150529-1857.jar -console -consoleLog
    

    或者,您可以在Equinox的config.ini文件中指定osgi.bundles(如果有的话)。

    您可以将必要的 jar 放入子文件夹中。在这种情况下,您必须使用 reference:file: 之后的相对路径。例如:reference:file:lib/myjar.jar.

    编辑

    我上传了两个示例(一个带有 config.ini,一个没有)到这里:https://drive.google.com/file/d/0B1GigvByKQkIbFRqbjFvbmNYdk0/view?usp=sharing

    【讨论】:

    • 答案已更新;)。似乎内置控制台已在 3.10 中删除。
    • 我添加了文件plugins\configuration.config.ini,内容如下pastebin.com/LtjYdUVH。我看到 jar 文件位于 plugins 目录中。所以我再次使用命令C:\equin\eclipse\plugins>java -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dosgi.console.enable.builtin=true -jar org.eclipse.equinox.la uncher_1.3.100.v20150511-1540.jar -console 启动了框架,但没有任何反应。(此测试是使用launchers-win32.win32.x86_64.Mars.zip 执行的)
    • 请注意,我使用 org.eclise.osgi 而不是 org.eclipse.runtime 来启动 OSGi 环境。我既没有使用 config.ini 也没有使用 plugins 目录,因为我想拥有最简约的解决方案(系统属性中的所有配置)。如果你想获取 config.ini 文件,我认为你必须为 org.eclipse.osgi jar 提供 -configuration 参数。
    • 我能请你帮个小忙吗?如果您成功启动下载的版本,您可以将其压缩并上传到保管箱吗?它会为我节省很多时间。
    • @BalazsZsoldos 在尝试了来自互联网的各种解决方案(也包括文档)5 小时后,对您的配置文件进行逆向工程让我能够在大约 30 分钟内解决问题。谢谢!顺便提一句。从您的示例 config.ini 中删除 osgi.console.enable.builtin=true,因为它有点误导。
    【解决方案2】:

    Eclipse 本身提供了预配置的 Equinox OSGi Starter Kits。他们很难找到。打开Equinox Project Download page 并单击OSGi 入门工具包的蓝色三角形。

    然后您可以为您的平台下载它们。它们具有本机可执行文件,但也具有“java -jar ...”执行的有效配置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-16
      • 1970-01-01
      • 2020-10-01
      • 1970-01-01
      • 2013-09-22
      • 2022-01-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多