简体   繁体   English

使用bndtools启动Eclipse 3.x RCP应用程序

[英]Launching an Eclipse 3.x RCP Application using bndtools

I have spent the past few days trying to find a solution to my problem. 过去几天,我一直在寻找解决问题的方法。 I am trying to launch an Eclipse RCP using the 3.x compatibility layer using the bndtools launcher via a bndrun file. 我试图通过bndruns文件通过bndtools启动器使用3.x兼容性层启动Eclipse RCP。

I am aware of the solution which involves placing bndtools.runtime.eclipse.applauncher in the list of run bundles in order to get an E4 application to start and that there are ways to migrate an E3.x application to E4. 我知道该解决方案涉及将bndtools.runtime.eclipse.applauncher放入运行包列表中,以启动E4应用程序,并且存在将E3.x应用程序迁移到E4的方法。 We would like to maintain programmatic control over the Rich Client Platform for the time being so migrating to an XMI file for laying out the Workbench is not ideal at this time. 我们希望暂时保持对Rich Client Platform的编程控制,因此目前不理想的是迁移到XMI文件以布置工作台。

I created a plug-in project which builds using bndtools. 我创建了一个使用bndtools构建的插件项目。 To my knowledge I have included all of the necessary bundles to run the application and have followed several examples (as an aside, most of the OSGI examples I found were console-based). 据我所知,我已经包括了运行该应用程序所需的所有捆绑软件,并遵循了几个示例(顺便说一句,我发现的大多数OSGI示例都是基于控制台的)。

Because I wasn't seeing the RCP load up (we have an RCP plug-in which extends the IApplication interface and our project structure is still Activator based) I was initially at a loss as to why this wasn't working but adding -osgi-console= to the run properties did provide some additional information: 因为我没有看到RCP加载(我们有一个RCP插件扩展了IApplication接口,并且我们的项目结构仍然基于Activator),所以最初我迷失了为什么它不起作用,而是添加了-osgi -console =的运行属性确实提供了一些其他信息:

Using -runfw: org.eclipse.osgi 使用-runfw:org.eclipse.osgi

The final lines are the following: 最后几行如下:

# framework=org.eclipse.osgi.launch.Equinox@59fa1d9b
# registered launcher with arguments for syncing
# will wait for a registered Runnable

Additionally, the plug-in I am using to test with is marked as STRTD and the bundle that is using it is also marked as STRTD whereas most other bundles are marked as ACTIV , which I assume is also part of the problem. 另外,我正在使用的插件被标记为STRTD,并且正在使用它的捆绑软件也被标记为STRTD,而其他大多数捆绑软件都被标记为ACTIV ,我认为这也是问题的一部分。 I have tried to force bundles to start by including a line to start several bundles (following other examples) but have run into issues where the console will error stating could not load or find main class for org.eclipse.core.runtime when trying to include that in the list of activated bundles. 我试图通过包含一行以启动多个捆绑包的方式来强制捆绑包开始(以下其他示例),但是遇到了以下问题:控制台将错误地指出在尝试加载时找不到或无法找到org.eclipse.core.runtime的主类。将其包括在已激活捆绑包的列表中。

Googling (and even Binging) have not appeared to produce a solution which explains how to set up an Eclipse 3.x application to run using a bndrun file. 谷歌搜索(甚至Binging)似乎还没有产生一种解决方案,该解决方案说明了如何设置Eclipse 3.x应用程序以使用bndrun文件运行。 What am I missing? 我想念什么? Most recently I tried the following properties: 最近,我尝试了以下属性:

-runproperties: \
 osgi.os=win32,\
 osgi.clean=true,\
 osgi.console=,\
 eclipse.product=org.eclipse.sdk.ide,\
 osgi.arch=x86_64,\
 osgi.ws=win32,\
 equinox.use.ds=true,\
 eclipse.application=org.eclipse.ui.ide.workbench

I assume that if the actual test bundle I am using would actually activate that I should also be able to find the application ID set in the plugin.xml file and to use that instead. 我假设,如果我正在使用的实际测试包能够真正激活,那么我也应该能够在plugin.xml文件中找到设置的应用程序ID并使用它。 Trying to activate that plug-in also results in a could not find main class error even though I specify a Bundle-Activator in the bnd file. 尝试激活该插件也会导致找不到主类错误,即使我在bnd文件中指定了Bundle-Activator也是如此。 That Activator does not appear to be started since I have it set to print to the console and nothing is printed. 该激活器似乎没有启动,因为我已将其设置为打印到控制台,并且没有打印任何内容。 I assume that since the bundle is in the STRTD state that it did not start. 我假设由于捆绑包处于STRTD状态,因此它没有启动。

Any help with this would be appreciated. 任何帮助,将不胜感激。

Edit: As an update, adding org.apache.felix.gogo.runtime and org.apache.felix.gogo.shell did result in my test plug-in's activator getting started. 编辑:作为更新,添加org.apache.felix.gogo.runtimeorg.apache.felix.gogo.shell确实导致我的测试插件的激活器开始使用。 Curiously the plug-in it is dependent on, though, moved from STRTD to RSLVD . 奇怪的是,它所依赖的插件已从STRTD迁移RSLVD

Other discussion has indicated that we might have to manually start an Eclipse instance using EclipseStarter ? 其他讨论表明,我们可能必须使用EclipseStarter手动启动Eclipse实例。

The following Github repo contains using an example with bndtools and Eclipse 3.8. 以下Github存储库包含使用bndtools和Eclipse 3.8的示例。 It uses an adapted bndtools.runtime.eclipse.applauncher inside /cnf/eclipse_common_3.8/bndtools.runtime.eclipse.applaunch-0‌​.1.0.jar see the 3.8 bnd launch config also include here example.aspectj/example.aspectj.bnd.app/run/launch_org.eclip‌​se.osgi_3.8.x.bndrun‌​. 它在/cnf/eclipse_common_3.8/bndtools.runtime.eclipse.applaunch-0‌.1.0.jar中使用了改编的bndtools.runtime.eclipse.applauncher。请参阅3.8 bnd启动配置,也包括example.aspectj / example.aspectj。 bnd.app/run/launch_org.eclip‌se.osgi_3.8.x.bndrun‌。 This was (beside the Aspect stuff demoed in the repo) the smallest set of bundles to startup an Eclipse app successfully with bnd. 这是(除了在仓库中演示的Aspect东西以外)使用bnd成功启动Eclipse应用程序的最小捆绑包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM