Are features optional or not in an Eclipse e4 application/plugin?
eclipse, eclipse-plugin, eclipse-rcp, java, swt
Solution
If you are creating a plugin based product on Eclipse 4, you still need most of the plugins that comprise the org.eclipse.e4.rcp feature. Try adding them from the list in http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/features/org.eclipse.e4.rcp/feature.xml
Problem
I am trying to understand the concept of eclipse `e4` for RCP. After reading following the tutorial, I am stuck in the following: Assume I create a `Plugin` project (no Rich Client unchecked, Actvator unchecked so no classes under /src etc) A plugin is the smallest deployable and installable software components of Eclipse. Ok. Now I can create a `Product Configuration` which is based on `Plugins` or `Features`. So the `Product Configuration` delivers the plugin etc and if I understand correctly the `Feature` is optional. Assuming that I am correct (don't know, am I?) I add to the product configuration the dependencies: `org.eclipse.emf.common` and `org.eclipse.emf.ecore` and press `Add Required Plugins` My product confuration is selected to be plugin based. What I don't understand at this point, is that if I don't define as part of the dependencies my plugin, I get a missing plugin when I run the application (I have checked the validate plugins before run). But why? The plugin, has already been defined as a "Definining Plugin" in product definition (New). Why do I have to explicitely add it also here? Anyway passing that, when I try to launch a window (yes I have created a `New Application Model` and defined a `Trimmed Window`) I get runtime exception ``` java.lang.RuntimeException: Application "org.eclipse.e4.ui.workbench.swt.E4Application" could not be found in the registry. The applications available are: org.eclipse.equinox.app.error. at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248) at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29) ``` I can only assume that this happens because a plugin is missing which is: `org.eclipse.e4.ui.workbench.swt` (I got this due to enabling validation of plugins) Why do I get this exception? I believe that I get it because I have not added the `org.eclipse.e4.rcp` as dependency. But I can not find it as an option. Turns out that this is available to be selected only if the product configuration is `based on Features`. It is not available for Plugins. Additionally the same process but defining a `Feature` and "attach" it as dependency to the product configuration works! I.e. no runtime exception and the window shows up. So what is happening? Are features mandatory? I don't understand. I thought they are optional. Could anyone help me figure this out? Update: If I manually add `org.eclipse.e4.ui.workbench.swt` as dependency (and press add required) in the `product` I get: ``` !ENTRY org.eclipse.osgi 2 0 2012-08-20 18:36:52.044 !MESSAGE One or more bundles are not resolved because the following root constraints are not resolved: !SUBENTRY 1 org.eclipse.osgi 2 0 2012-08-20 18:36:52.044 !MESSAGE Bundle initial@reference:file:plugins/org.eclipse.e4.ui.workbench.swt_0.10.1.v20120525-2014.jar was not resolved. !SUBENTRY 2 org.eclipse.e4.ui.workbench.swt 2 0 2012-08-20 18:36:52.044 !MESSAGE Missing required bundle org.eclipse.core.databinding_[1.2.0,2.0.0). ```