| This mini-howto is outdated! Binding product-export mojo to eclipse-plugin project lifecycle does not guarantee proper build order and will likely result in unexpected results or failures like MNGECLIPSE-1272. Recommended way to build Eclipse RCP applications is using separate project with packaging=eclipse-application. |
Before start, install Eclipse RCP with delta pack:
- Go to the Platform downloads page.
- Pick the build you want to use as your RCP target (e.g. the 3.4.1 milestone build).
- In the RCP SDK section (not the Eclipse SDK, Platform SDK, or RCP Binary sections) download the RCP SDK for your platform. This contains just the base RCP plug-ins for that platform.
- Extract it to a different directory than the IDE's (e.g. c:\eclipse-RCP-SDK).
- Optionally, if you want to deploy to other platforms, download the Delta Pack (the link is at the bottom of the RCP SDK section). This contains the platform-specific plug-ins for all platforms. Extract it to the same location as the RCP SDK (say OK to any prompts to overwrite files).
- Run the IDE (e.g. c:\eclipse\eclipse.exe).
- Go to Window > Preferences > Plugin-Development > Target Platform, and configure the location to be the eclipse subdirectory of the RCP SDK install (e.g. c:\eclipse-RCP-SDK\eclipse). Note: if you type or paste the path, you'll need to press the Reload button.
- The list of plug-ins on the Plug-ins tab should update to show the RCP SDK plug-ins; other plug-ins like those for JDT and PDE should not appear.
Below are the steps required to export a Hello world rich client application. If you wanna to download the entire project click HelloWorld.zip.
- Open Eclipse.
- Create a new Plug-in Project
- Go to next step. Uncheck "Generate an activator..." and check yes on "Would you like to create a rich client application?"
- Pick "Hello RCP" template and Finish.
- Run the plug-in to be sure if everything is ok.
- Create a new "Product Configuration"
- Type product name (HelloWorld) and select application (HelloWorld.application)
- On ID press new then Finish (use suggest values)
- Go to configuration tab and click on "Add..." select "HelloWorld" on the list. And press OK
- Click on "Add Required Plugins". Your plugin list should like this:
- Switch back to Overview tab and "Launch an Eclipse application", if eclipse launches hello world app it is a sign you did everything right so far. If don't launch, do a double check on your steps.
- Open project folder and run generate-poms:mvn org.codehaus.tycho:maven-tycho-plugin:generate-poms -DgroupId=tycho.demo -Dtycho.targetPlatform=your eclipse installation
- Add product export configurations to pom.xml
<build> <plugins> <plugin> <groupId>org.codehaus.tycho</groupId> <artifactId>maven-osgi-packaging-plugin</artifactId> <version>${tycho-version}</version> <executions> <execution> <phase>package</phase> <id>product-export</id> <goals> <goal>product-export</goal> </goals> <configuration> <productConfigurationFile>HelloWorld.product</productConfigurationFile> <!-- replace to your real goal if you didn't use same namming --> </configuration> </execution> </executions> </plugin> </plugins> </build> - Run mvn clean package
- Open target/product directory. You can see the launcher file (launch.exe at windows). Just double click on it and you will get you HelloWorld open.