Deploying outside of Eclipse
After developing an application, the goal is to deploy and run stand-alone applications without the user having to know anything about the Java and Eclipse code being used underneath. For a real application, you will likely provide a self-contained executable generated by an installation program like InstallShield or NSIS. This is beyond the scope of this tutorial, so you will instead create a simplified version of the Eclipse installation directory. This directory has to contain the native launcher program, startup.jar, config.ini, and all the plug-ins and features required by the product.
Eclipse provides an Eclipse Product export wizard to help you build the Eclipse installation directory on your file system.
All plug-in and feature projects contain a build.properties file. This file is used by Eclipse to figure out what files should be exported. Before exporting the RCP application, you must update this file with the additional files or folder that were added to the com.ibm.plte plug-in and the com.ibm.plte feature. The build.properties file does not have to be updated manually. You can use the build page of the plugin.xml or feature.xml editor.
Steps to take:
- Go to the build page of the com.ibm.plte (plugin.xml) editor. Select the following files or folder to export with the com.ibm.plte plug-in and save the file:
- icons folder
- Go to the build page of the com.ibm.plte (feature.xml) editor. Select the file license.html to export with the com.ibm.plte feature and save the file.
- Go to the overview page of the plte.product editor and click Eclipse Product export wizard to launch Export wizard.
- Select Directory as the Export Destination. Specify a location on the file system to export the RCP application and click Finish.
Steps to take:
- Ensure that you closed the previously launched RCP application. Using a command prompt window, go to the location where you exported the application. Run the plte.exe command. The same RCP application you ran previously will open.
- Click Help > About PLTE to open the About dialog box. Notice that the dialog box contains two icons above the Feature Details button. The first represents the org.eclipse.rcp feature, and the second represents the com.ibm.plte feature.
Figure 18. Hello World RCP application's About dialog box
- Click Feature Details to open the About Feature dialog box.
- Select the com.ibm.plte feature. Notice that the License button is enabled. This is because you added a license.html file earlier.
- Click License to open license.html in a browser.
Figure 19. Hello World RCP application's sample license
- Locate and open the com.ibm.plte plug-in's plugin.xml. Notice that this plug-in defines three extension points:
- org.eclipse.core.runtime.applications -- Created in Part 1 using the Hello RCP template
- org.eclipse.ui.perspectives -- Created in Part 1 using the Hello RCP template
- org.eclipse.core.runtime.products -- Created in Part 3 using the Product Configuration editor
Figure 20. com.ibm.plte plug-in's plugin.xml
- Go back to the Eclipse workbench. Click Run > Run to open the Run dialog box and select Eclipse Application > Eclipse Application configuration. Notice that this configuration contains the application com.ibm.plte.application and product com.ibm.plte.product.
Figure 21. Launch Configuration dialog box