Eclipse Target Platform. Via a target platform you define which set of plug-ins and what version of Eclipse you develop against. This tutorial describes how to setup your target platform for Eclipse Plug-in and RCP development.
1. Defining available Java libraries with the target platform
Before you can start developing Eclipse components, you need to define libraries to compile against.
Eclipse uses target files to define the set of available Java libraries (via JAR files) for Eclipse development. This set is called the target platform and can be used in addition to your plug-in projects in your workspace.
Usinga target file to control and specify the available libraries and their versions is good practice. A target definition file is typically shared between the developers to ensure that everyone is using the same basis for development.
If no target file is defined and activated, the set of JAR files (plug-ins) of the Eclipse IDE are used as target platform. This should be avoided as it makes the development dependent on the specific version of the used IDE.
1.1. Creating a target platform
You can create a target definition file by navigating to
.You can add new libraries via the Add… button in the Locations section. Different options are supported, for example:
-
Eclipse (p2) update sites
-
File locations
-
Standard Java libraries from Maven repositories (require an IDE extension)
The following is an example of a target definition file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="target-platform">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/latest"/>
<unit id="org.eclipse.equinox.compendium.sdk.feature.group"/>
<unit id="org.eclipse.equinox.core.feature.feature.group"/>
</location>
</locations>
</target>
Entries for Eclipse update sites are defined via the includeMode
property how dependencies of Eclipse components are handled:
-
planner = include dependencies automatically in the target platform
-
slicer = don’t include dependencies automatically in the target platform
1.2. Setting a target platform as active
Activating a target platform will download the necessary JAR files, convert them into plug-ins if needed, and make them available for development.
You can activate and switch the target platform in the Eclipse Preferences. Select
.It is possible to activate a target platform via the target file editor with the Set as Active Target Platform link on the first page.
2. Exercise: Create a target platform definition file
In this exercise, you create a target definition file to define the available libraries during development.
2.1. Create a project of type general
Create a new General-type project named target-platform via the
menu path.

2.2. Create a target definition file
Create a new target definition file via the
menu path.
Use target-platform
as file name and press the Finish button.

This creates a new file and opens the Target Definition editor.
2.3. Setting up a target platform for RCP or OSGi development
The following describes the definition of two target platforms. One for Eclipse IDE / RCP development and the other one for OSGi development.
2.4. Defining the target platform content
In this exercise, you add the Eclipse libraries to your target definition.
Ensure your target definition file is open in the Target Definition editor. Switch to the Source tab of the editor. Copy and paste the following text into the file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="target-platform">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/2024-12"/>
<unit id="org.eclipse.equinox.sdk.feature.group"/>
<unit id="org.eclipse.platform.feature.group"/>
</location>
</locations>
</target>
Save the target definition file.
Your repository location
points to an Eclipse update site containing Java libraries.
The unit entries define the libraries you want to use.
It is possible to enter Maven dependencies in your target platform if the M2E-PDE integration is installed into your IDE.
The Eclipse project offers update sites for different versions. Use the following URL if you develop against the latest release. You can develop with a specific release, for example:
|
It is possible to define the desired version of a library via the version tag, for example:
To see the available versions, you can use code completion via CTRL+Space in the version field.
As of the 2024-12 release the version tag is optional and defaults to |
2.5. Add option to use NatTable in your code
NatTable
is an advanced framework for building tables and trees.
We want to be able to use NatTable
in our development environment.
Therefore, modify your target platform.
Open the target definition file in the target definition editor and add the following entries.
Name | URL |
---|---|
NatTable update site |
https://download.eclipse.org/nattable/releases/1.6.0/repository/ |
vogella sample data model |
https://dl.bintray.com/vogellacompany/codeexamples-javadatamodel/updatesite/1.4.0/ |
The data model is of course not necessary for the usage of Nattable but will give us a simple data model to use NatTable.
The following features of the update sites above should be added to the target definition file.

Ensure you activate this target definition by clicking on the Set as Target Platform link in the target definition editor.
A target platform file which supports NatTable should therefore have at least the following entries, you may have more entries.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="target-platform">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/latest"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/nattable/releases/1.6.0/repository/"/>
<unit id="org.eclipse.nebula.widgets.nattable.core.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.nebula.widgets.nattable.core.source.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.nebula.widgets.nattable.extension.e4.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.nebula.widgets.nattable.extension.e4.source.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.nebula.widgets.nattable.extension.glazedlists.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.nebula.widgets.nattable.extension.glazedlists.source.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.nebula.widgets.nattable.extension.nebula.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.nebula.widgets.nattable.extension.nebula.source.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.nebula.widgets.nattable.extension.poi.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.nebula.widgets.nattable.extension.poi.source.feature.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://dl.bintray.com/vogellacompany/codeexamples-javadatamodel/updatesite/1.4.0/"/>
<unit id="com.vogella.model.feature.feature.group" version="0.0.0"/>
<unit id="com.vogella.model.feature.source.feature.group" version="0.0.0"/>
</location>
</locations>
</target>
2.6. Exercise: Setting up a target platform for OSGi development
In this exercise, you create a target definition which can be used to develop OSGi based command line applications.
2.6.1. Add content for OSGi development
Press the Add… button.

Select Software site in the following dialog.
Depending on your installation, you may see different entries in the dialog, e.g. you may see an additional entry named Maven.

Press the Next button and enter the following URL in the Work with selection box.
https://download.eclipse.org/releases/latest
https://download.eclipse.org/releases/latest points to the latest Eclipse release, you can select a specific release to build against.
|
Remove the Group by Category flag and add the following components:
Component | Description |
---|---|
Equinox Compendium SDK |
Additional OSGi services |
Equinox Core Function |
Basis runtime and functionality of OSGi |

Save the target definition file.
2.7. Example solution for the target platform
If you check the content of the target platform via the Source tab, it should look similar to the following listing.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="target-platform">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/latest"/>
<unit id="org.eclipse.equinox.compendium.sdk.feature.group"/>
<unit id="org.eclipse.equinox.core.feature.feature.group"/>
</location>
</locations>
</target>
2.8. Activating the target definition file
In the target file editor select the Definition tab.
After the target is resolved, press the Set as Active Target Platform to activate it.

After activation this changes to Reload Target Platform.

Avoid using the Eclipse IDE until the target is resolved and activated. Activating target definitions accesses the network and you do not want to interrupt this, as this might result in an inconsistent target definition. |
2.9. Solving potential issues with your target definition
Your target platform depends on external update sites and the availability of the network. These update sites might change over time, so you should be able to revert your target platform settings in case you face issues.
If you face issues with your target platform, switch to the IDE as target platform and afterwards switch back to your target definition. This sometimes solves target resolution issues. |
If you have problems accessing the network, you can (temporarily) use the Eclipse IDE as a target platform via
.
In the past, it was sometimes necessary to restart the Eclipse IDE to apply changes in the target platform. These bugs should be fixed in the latest release, but in case you discover new bugs, you may want to try that. |
3. Optional exercise: Mirroring p2 update
To avoid long running network operations to server outside the own network, you can mirror p2 update sites.
Mirroing with Tycho p2 explains how to mirror an update site with Maven. |
One way is to use Eclipse to mirror a update site, for this you need to mirror the metadata and the artifacts.
The following is an example for Windows, which mirrors the latest update site to C:\Users\Lars\mirror.
./eclipsec -nosplash -verbose -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -source https://download.eclipse.org/releases/latest -destination C:\Users\Lars\mirror
./eclipsec -nosplash -verbose -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source https://download.eclipse.org/releases/latest -destination C:\Users\Lars\mirror
./eclipse -nosplash -verbose -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -source https://download.eclipse.org/releases/latest -destination ~/mirror
./eclipse -nosplash -verbose -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source https://download.eclipse.org/releases/latest -destination ~/mirror
This mirroring can run very, very long. But it still can be useful to do this, as you could upload the mirrored artifacts on a server in your network. This will make the target definition resolution most likely faster for your developers. |
After a successful run, you can change your target platform for the platform features to point to the mirrored p2 update site.
4. Learn more and get support
This tutorial continues on Eclipse RCP online training or Eclipse IDE extensions with lots of video material, additional exercises and much more content.
5. Target platform resources
5.1. vogella Java example code
endifdef::printrun[]
If you need more assistance we offer Online Training and Onsite training as well as consulting