title: How to make RCP application really standalone?
body: <p>If I create <code>Headless Hello RCP</code> application</p>
  
  <p><img src="https://i.stack.imgur.com/1AVd6.jpg" alt="enter image description here">
  <img src="https://i.stack.imgur.com/tdvF1.jpg" alt="enter image description here"></p>
  
  <p>I can run it under Eclipse debugger as any normal java application. It runs and prints "Hello world" into Eclipse console.</p>
  
  <p>Now how to make it really standalone, i.e. running without MY CURRENT Eclipse? </p>
  
  <p>Exporting to runnable JAR does not work with such a project.</p>
  
  <p>Exporting to Eclipse product also does not work for it.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>If I create product file for the project, then exporting to product starts to work, but the application itself starting to crash while running. This is probably due to wrong guesses I made during product file creation.</p>
  
  <p>Firstly created product file looks not full filled for me:</p>
  
  <p><img src="https://i.stack.imgur.com/vG9PK.jpg" alt="enter image description here"></p>
  
  <p>Trying to fill <code>Product</code> dropdown I use <code>New</code> button and create product from my current project</p>
  
  <p><img src="https://i.stack.imgur.com/A4xv9.jpg" alt="enter image description here"></p>
  
  <p>I used some guessing when filling <code>Application</code> cell. I set there some entry, which corresponds somehow with my current project name.</p>
  
  <p>Resulting application crash with an exception:</p>
  
  <pre><code>!ENTRY org.eclipse.equinox.launcher 4 0 2013-12-18 03:29:41.305
  !MESSAGE Exception launching the Eclipse Platform:
  !STACK
  java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:633)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
  </code></pre>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>This FAQ entry <a href="http://wiki.eclipse.org/FAQ_How_do_I_create_an_Eclipse_product%3F" rel="nofollow noreferrer">http://wiki.eclipse.org/FAQ_How_do_I_create_an_Eclipse_product%3F</a> describes some procedure, which does not work in reality.</p>
  
  <p><strong>PLUGIN.XML</strong></p>
  
  <p>When adding products extension point to plugin.xml, Eclipse warns that </p>
  
  <pre><code>A minimum of 1 'provider' elements must be specified.
  A minimum of 1 'product' elements must be specified.
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/bYwtN.jpg" alt="enter image description here"></p>
  
  <p>It is not described in the FAQ, whether this should be done and how. </p>
  
  <p>Suppose we remain file as is.</p>
  
  <p><strong>PRODUCT FILE</strong></p>
  
  <p>Later when creating product file, it is also unclear how to fill it:</p>
  
  <p><img src="https://i.stack.imgur.com/68dkT.jpg" alt="enter image description here"></p>
  
  <p>If filled as written in the FAQ (see above, only product id is set), the resulting application does not run with exception:</p>
  
  <pre><code>!SESSION Wed Dec 18 13:32:36 MSK 2013 ------------------------------------------
  !ENTRY org.eclipse.equinox.launcher 4 0 2013-12-18 13:32:36.300
  !MESSAGE Exception launching the Eclipse Platform:
  !STACK
  java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:633)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
  </code></pre>
  
  <p><strong>UPDATE3</strong></p>
  
  <p>I found the following points:</p>
  
  <p>1) Product should be described both in <code>plugin.xml</code> file and in <code>.product</code> file. In <code>plugin.xml</code> file the product is represented as a contribution to <code>org.eclipse.core.runtime.products</code> point (<code>&lt;extension&gt; tag</code>). This tag of <code>plugin.xml</code> file can be created automatically by <code>.product</code> file creation wizard, by <code>New</code> button.</p>
  
  <p>2) Application is also represented in <code>plugin.xml</code> file as contribution to <code>org.eclipse.core.runtime.applications</code>. This should be preconfigured before running <code>.product</code> creation wizard. The <code>id</code> of the application in <code>plugin.xml</code> file is not fully qualified. FQN is appeared if prepended by plugin name, which is written in <code>MANIFEST.MF</code> file. So, while running <code>.product</code> creation wizard one should calculate FQN of an application in mind and set it.</p>
  
  <p>3) The result of final running depends not only on all above, but also on <code>Debug As -&gt; Debug Configurations</code> or <code>Run As -&gt; Run Configurations</code>. There is a <code>Plug-ins</code> tab there with several magic controls:</p>
  
  <p><img src="https://i.stack.imgur.com/BxVUS.jpg" alt="enter image description here"></p>
  
  <p>By default even main application is not included.</p>
  
  <p>Concerning all this I was able to walk approximately entire way, but finally stuck at new obstacle:</p>
  
  <p>When running final exported application, I get an exception:</p>
  
  <pre><code>!SESSION Wed Dec 18 19:04:36 MSK 2013 ------------------------------------------
  !ENTRY org.eclipse.equinox.launcher 4 0 2013-12-18 19:04:36.695
  !MESSAGE Exception launching the Eclipse Platform:
  !STACK
  java.lang.RuntimeException: Could not find framework
          at org.eclipse.equinox.launcher.Main.getBootPath(Main.java:992)
          at org.eclipse.equinox.launcher.Main.basicRun(Main.java:571)
          at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
  </code></pre>
  
  <p><strong>UPDATE 4</strong></p>
  
  <p>After adding <code>org.eclipse.core.runtime</code> to dependencies of <code>.product</code> file, the last problem was solved. The next problem is an excpetion</p>
  
  <pre><code>!SESSION 2013-12-18 19:43:31.136 -----------------------------------------------
  eclipse.buildId=unknown
  java.version=1.7.0_40
  java.vendor=Oracle Corporation
  BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
  Command-line arguments:  -os win32 -ws win32 -arch x86_64
  
  !ENTRY org.eclipse.osgi 4 0 2013-12-18 19:43:31.924
  !MESSAGE Application error
  !STACK 1
  java.lang.RuntimeException: Application "MyApp.id1" 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)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
  </code></pre>
  
  <p>(application id is different in this run, but is correct)</p>
  
  <p><strong>UPDATE 5</strong></p>
  
  <p>I found that my application class does not present anywhere in exporting directory.</p>
  
  <p>How to force it to go there?</p>