1. Product configuration file

1.1. Using a product configuration file

A product configuration file (product) defines the configuration of an Eclipse application. This includes icons, the splash screen, and the necessary plug-ins and features.

You create a new product file via the File  New  Other  Plug-in Development  Product Configuration wizard and change it with the product configuration editor.

A product configuration must define the application to start. The commonly used applications are:

  • org.eclipse.ui.ide.workbench for Eclipse IDE-based applications

  • org.eclipse.e4.ui.workbench.swt.E4Application for Eclipse RCP applications not related to the IDE

Product extension definition

You can also use a custom application which implements the IApplication interface.

On the Overview tab of the editor, you can start the product. Pressing the Synchronize link writes the relevant product configuration information into the plugin.xml file.

On the Contents tab, you define the set of plug-ins and features that are included in the final application.

1.2. Splash screen

The Splash tab allows you to specify the plug-in that contains the splash screen.

The splash screen image can be in any of the following formats: PNG, JPG, GIF, or BMP. Transparency and animation are not supported.

The file name is predefined as splash.EXTENSION and the file must be located in the root directory of the plug-in. Therefore, put one of the following files into the root directory of the project:

  • splash.png

  • splash.jpg

  • splash.jpeg

  • splash.gif

  • splash.bmp

Show the splash tab from the product configuration file

The location of the splash screen image can be changed via the osgi.splashPath parameter, and the file can be set directly with the -showsplash path_to_file option.

1.3. Icons, launcher name, and program and VM arguments

You can configure the launcher name and icon for your product. The launcher is the executable program that is created during the deployment of the product. A launcher is platform-specific. For example, the default launcher on Windows is called eclipse.exe and has an associated icon. To change the file name of the launcher and its icon, use the Launching tab of your product configuration. Ensure that the icons are in the correct format, otherwise they are not used.

The icon configuration depends on the platform you are using. Eclipse allows you to export your application for multiple platforms and uses the correct icons based on your product configuration.

In the Launching Arguments section, you can specify parameters for your Eclipse application and arguments for the Java runtime environment. Program Arguments are passed to the Eclipse application, VM Arguments to the Java virtual machine.

The Launching Arguments section of the product configuration editor.

1.4. Product configuration limitations for Eclipse RCP applications

The splash handlers that can be registered via the Customization part of the Splash tab are not used by Eclipse RCP applications based on the Eclipse 4 API. Additionally, the configuration in the About Dialog and the Welcome Page section on the Branding tab is not directly supported in Eclipse RCP applications. These only work for Eclipse applications using the 3.x API.

2. Using features

2.1. Definition of feature projects and features

An Eclipse feature project defines a feature. You create feature projects with a wizard, similar to plug-in projects.

A feature describes a list of plug-ins and other features which form a set of related components. It has a name, a version number and, in most cases, license information.

A feature is described via a feature.xml file. The following listing shows an example of such a file.

<?xml version="1.0" encoding="UTF-8"?>
<feature
      id="com.vogella.eclipse.featuretest.feature"
      label="Feature"
      version="1.0.0.qualifier"
      provider-name="vogella GmbH">

   <description url="https://www.example.com/description">
      [Enter Feature Description here.]
   </description>

   <copyright url="https://www.example.com/copyright">
      [Enter Copyright Description here.]
   </copyright>

   <license url="https://www.example.com/license">
      [Enter License Description here.]
   </license>

   <plugin
         id="com.vogella.eclipse.featuretest"
         version="0.0.0"/>

</feature>

Grouping plug-ins into logical units makes them easier to handle. Instead of adding many individual plug-ins to your product configuration file, you add a few features. This also makes the structure of your application more visible.

Features can be installed into Eclipse applications and are used to define Eclipse products. They can also be used as a basis for a launch configuration.

Eclipse provides several predefined features, for example, the org.eclipse.e4.rcp feature, which contains the most commonly used plug-ins for Eclipse applications.

2.2. Feature or plug-in based products

A product can either be based on plug-ins or on features. You select this on the Overview tab of the product configuration file.

On the Contents tab of the product editor, you enter the plug-ins or features your product consists of. The Include required Features and Plug-ins automatically option adds their dependencies automatically.

2.3. Creating a feature

You can create a new feature project via the File  New  Other…​  Plug-in Development  Feature Project menu entry.

If you open the feature.xml file, you can change the feature properties in the feature editor.

The Information tab allows you to enter a description and copyright information for this feature.

The Included Plug-ins tab allows you to change the plug-ins included in the feature. To add a plug-in to a feature, use this tab. A frequent error is to add it to the Dependencies tab instead.

The Included Features tab allows you to include other features in this feature. The Dependencies tab allows you to define other features that must be present to use this feature.

The Build tab is used for the build process and should include the feature.xml file. The last two tabs give access to the configuration files in text format.

3. Deployment of the application

3.1. Creating a stand-alone version of the application

An Eclipse application needs to be exported (also called deployed) to run outside the Eclipse IDE. Exporting your product creates a folder with all required artifacts to run your application. This includes a native launcher for each platform you export for, such as Windows or Linux.

The product editor still offers a manual export, but it does not work reliably anymore, because the Eclipse platform itself is built with a command line build based on Maven. Therefore, use a Maven Tycho build to build and deploy your application. With current Tycho versions, setting up such a build for Eclipse-based applications and plug-ins requires little configuration.

3.2. Checklist for common export problems

If the export encounters a problem, see the following table for a solution.

Table 1. Problems with the product export
Problem Possible cause

Export fails

Try an empty target directory, sometimes the export cannot delete the existing files and therefore fails.

No executable file after the export

Check the flag The product includes native launcher artifacts in your .product file on the Overview tab.

Product could not be found

Validate that all dependencies are included in the product. Delete an existing launch configuration and restart the product from the IDE to see if everything is configured correctly.

Splash screen or other icons are missing

Check the build.properties file to see if all required images and icons are included in the export.

Splash screen is missing

Ensure that you have entered the defining plug-in on the Splash tab of the product configuration file. If this is not set, the splash screen is not displayed after the export, even though it is displayed if you start the product from the Eclipse IDE.

Issues during the start of the application

Check the log file in the workspace folder of your exported application to see the error messages during the start process. Alternatively, add the -consoleLog parameter to the .ini file in the folder of the exported application.

applicationXMI argument is missing

Check the build.properties file to see if the Application.e4xmi and the plugin.xml files are included in the export.

Service could not be found or injected

Ensure that the bundle that provides the service has the Activate this plug-in when one of its classes is loaded flag set. Also ensure that the org.apache.felix.scr bundle is started automatically with a start level lower than 4.

Application ID could not be found

Define a start level of 1 and set auto-start to true for the org.eclipse.core.runtime plug-in.

Translations not available in the exported product

Ensure, via the build.properties file of the relevant plug-in, that the files containing the translations are included in the export.

3.3. Exercise: Use a static splash screen

Add a splash screen to your application. For this create or download a splash.bmp bitmap file.

Add the splash.bmp file to the main directory of your application. You can copy and paste it into the Package Explorer or Project Explorer view.

If you add files outside the Eclipse IDE, you need to Refresh your project to see the file in Eclipse. This can be done via the F5 key binding in the Package Explorer view.

The file name and the location of the file must be correct, otherwise Eclipse will not use your splash screen.

On the Splash tab of your product configuration file, define that your application plug-in contains the splash screen.

Adding splash to the product configuration file

Start your application from the Eclipse IDE and verify that the splash is displayed.

3.4. Include the splash screen in the exported application

Configure that the splash.bmp file is included in the exported application by adding it to the build.properties file of your application plug-in.

Add splash to build properties

Make sure that the target directory of the export is empty before you start the export.

4. Optional exercise: Use a custom feature in the product

You can group your plug-ins into a custom feature. This is not required and is unnecessary overhead if you only have one plug-in, but it helps to organize many plug-ins.

4.1. Create a feature project

Create a new feature project named com.example.e4.feature via the File  New  Other…​  Plug-in Development  Feature Project entry. The following screenshot shows the first wizard page.

Creating a feature

Include the com.example.e4.rcp plug-in into the new feature.

Include plug-in into a feature

4.2. Create a new project for the product configuration file

Currently, the com.example.e4.rcp plug-in contains the .product file. While you could leave the .product file in its current location, a typical project setup keeps the product in its own project. This is because a product defines settings for the whole application and does not closely relate to only one plug-in.

Therefore, create a new project of type General named com.example.e4.product and move the product file to this project.

Project Explorer with the com.example.e4.rcp.product file

4.3. Ensure that the product configuration file allows plug-ins and features

Ensure that the .product file is open. Select the Overview tab and ensure the plug-ins and features option is selected.

Switching to features and plug-ins in the product configuration file

4.4. Add the features as content to the product

Switch to the Contents tab in your product editor. The following entries should already be present.

  • org.eclipse.e4.rcp

  • com.example.e4.rcp

Remove the com.example.e4.rcp entry via the Remove button. We want to add the feature instead of the plug-in.

Add the following feature to your product via the Add Feature…​ button.

  • com.example.e4.feature

Contents tab of the product configuration with the com.example.e4.feature
The Include required Features and Plug-ins automatically option adds required dependencies to the product.

4.5. Start the application via the product

Start your application using the product configuration file and ensure that the application starts correctly. If everything is configured correctly, the application should start as before with no visual difference.

If the application does not start, check that you start your application using the product configuration and not with an existing launch configuration. This ensures that your new product configuration is used.

5. Eclipse product and export resources

Home Tutorials Training Consulting Books Company Contact us


Get more...