title: Close Eclipse Application Programmatically
body: <p>I have an Eclipse Application that I want to close. The catch is that it is a headless application, so I can not use the following method:</p>
  
  <pre><code>PlatformUI.getWorkbench().close();
  </code></pre>
  
  <p>What alternative can I use to close the application cleanly?</p>
  
  <p>My main plugin, the one that defines the product and the application, contains the following dependencies:</p>
  
  <ul>
  <li>org.eclipse.core.runtime</li>
  </ul>
  
  <p>And that is about it.</p>
  
  <p>I use the extension points:</p>
  
  <ul>
  <li>org.eclipse.core.runtime.applications</li>
  </ul>
  
  <p>To define my app.</p>
  
  <p>I create a Swing UI for it, and I want to be able to close the application after a certain process is done, or as a result of a user action.  I wonder if there is any API in Eclipse to do that, or in this case that I handle the UI on my own, do I have to close the application by exiting on the class that implements IApplication.</p>