Eclipse 4.0 and tutorial on writing e4-RCP-application released
July 28, 2010 32 Comments
The Release
The e4-Team just announced the availability of the Eclipse 4.0 SDK “Early Adopter Release” (Reviewslides) which marks a major platform update since the inception of 3.0 6 years ago.
Just to reiterate what the 4.0 SDK is and to set expectations right. The 4.0 SDK is marked as an “Early adopter release” targeted at Plug-in Developers who want to test their code on the upcoming 4.x platform and report problems because of broken APIs or “APIs” not available anymore because they used internals of the platform.
The 4.0 SDK “Early Adopter Release” is not targeted for use as your Primary IDE so keep this rough edges in mind when giving the 4.0 SDK a try.
When takeing a closer look to the release you’ll notice that in reality multiple different things have been released:
- Eclipse 4.0:
- Eclipse 4.0 Application Platform: The new application platform to write OSGi-base (UI-)Applications centered around a new programming model using DI and a modeled application kernel
- Eclipse 4.0 Compatible Rich Client Platform: Compability layer for API clean 3.x bundles to run unmodified on the new Application Platform
- Eclipse 4.0 SDK: Eclipse 4.0 Application Platform + Eclipse 4.0 Compatible Rich Client Platform + PDE 3.6 + JDT 3.6
- Eclipse 4.0 Technologies (also called “e4 SDK 0.10″ / “e4 release July 2010″ because the releasing project is e4):
- XWT + Tooling: XAML for SWT/JFace and Visual Designer Tools
- Semantic Filesystem implementation
- Application Modeltooling
A small hint for Plug-in developers who are trying to debug their Plug-In by launching an inner Eclipse and all Eclipse 4.0 Application-Developers. The Eclipse 4.0 SDK misses at the moment the source bundles for the new Eclipse 4.0 components and you need to install it through the p2-repositories pre configured for you.
We recommend to install:
- EMF SDK
- Modeled Workbench Source
- CSS Support Source
to successfully step through the code using the debugger.
My personal main focus in the Eclipse 4.0 development for the last 2 years has been the “Eclipse 4.0 Application Platform” whose goal is to modernize and simplify the development of OSGi-based UI-Application using DI and a modeled application approach. In the last few months I also worked on a tool to make writing applications for the Eclipse 4.0 Application Platform easier.
The model tooling
Since March I’ve been dedicated half of my 4.0 development time implementing support for the application model underpinning the Eclipse 4.0 Application Platform.
The model tooling has not yet graduated out of the e4-incubator and so is not part of the Eclipse 4.0 SDK download and you’ll have to install it using the preconfigured e4-repository – you find it in the “E4 Tools”-category.
The tooling is working in 2 modes:
- Design/Development-Time mode: This is the standard mode you are using when developing an application. In this mode you operate on a Application-Model persisted as a XMI-File in your workspace.
- Live mode: In this mode you are operating on the live model of a running application and are able to inspect and modify live
The Eclipse 4.0 Modeltooling is written to run native on the Eclipse 4.0 Application Platform (no useage of the Backward-Compat-Layer) but also integrates smoothly in the Eclipse 4.0 SDK.
Probably one of the most remarkable things though is that it runs also in a 3.6 SDK enabled by the so called Forward Compat Layer I started developing who does the opposite of the backward-compat-layer. It allows you to run components using the Eclipse 4.0 Progamming model which is built upon POJOs and DI in a 3.6 environment.
This makes it possible to write Eclipse 4.0 Applications using the 3.6 SDK as the screenshot demonstrates:

All you need is to install the tools using the e4 Update Site which is available on http://download.eclipse.org/e4/updates/2010.
The tutorial
When introducing new technologies we know that it is important to give people a medium sized example application which explains the concepts of the framework and provides them “monkey see, monkey do” example code. That’s why I’ve worked in the last few days/weeks on a tutorial which helps people getting started writing applications using the “Eclipse 4.0 Application Platform”
You can download the tutorial which is released under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 using this link. The sources codes are released under EDL-1.0/EPL-1.0 and are available from github and/or as individual zips (urls found in the PDF).
If you only want to take a look at an application built using the Eclipse 4.0 Application Platform you can downloaded using the links below:
- Mac Version (cocoa32bit,cocoa64bit)
- Linux Version(32bit,64bit)
- Win32 Version(32bit,64bit)
You need Java 6 to run the demo although Eclipse 4.0 itself only needs Java5. To get accounts displayed on the left you should enter the following values in the Preference Dialog:
- Username: john
- Password: doe
- Host: blabla.com
It looks like the update-code triggering of the AccountView is a bit weak so if you are not informed about the opening of the session after clicking around stop and starting the application should help you (I’ll try to work on a solution in the days to come).
Just in case you like the service I’m providing to you for free with this tutorial and you want to donate some cents here’s the button to push:

Tutorial-Update
- 2010-08-10:
- Fixed unclear section on page 6
- Added warning to not install Visual WorkbenchTooling


Thank you, Tom! This is an excellent post, great job and a perfect tutorial!!
Thanks for good tutorial.It would be great if there is sample e4 with Hibernate with persistence context .
Hi,
I try to follow this excellent tutorial, but i don’t manage to add Tools with update manager. EMF dependancy is missing. Do you know this issue? Wich version of SDK is better to download to follow the tutorial?
Thanks
Did you download the 4.0 SDK? The update-manager should resolve EMF just fine but you could also install EMF-SDK first using the Helios-Update-Site part of the preconfigured Repository in 4.0 SDK.
Yes i downloaded the 4.0 SDK. I don’t understand, i’ll try later with not “early adpter” release.
Thanks
Not sure what’s going wrong for you. You need to make sure the update-manager “Contact all other update sites during install to find required software” is checked. Does installing the EMF-SDK throught the helios update site (Helios – http://download.eclipse.org/releases/helios) work?
Great job! In fact, I face the same issue: I think you should recommend to add Helios update site to make sure all dependencies will be solved.
Once again, thanks for the great work.
hm – isn’t the Helios update-site preconfigured in the Eclipse 4.0 SDK?
Nope, my Eclipse 4.0 came without any update site.
Do you by chance still have the URL you downloaded the zip from or give me a detailed Version number? What’s the exact name of the ZIP?
just get it from http://download.eclipse.org/e4/sdk/drops/R-4.0-201007271520/
Note, I took the x86 64 bits version (eclipse-SDK-4.0-win32-x86_64.zip)
Hope that helps
Thanks for the information – I’ve forwarded the message to the e4-IRC so that we can probably find out what’s wrong to fix it at least for the next milestones. I’ve update the tutorial to troubleshoot the situation.
OK with : C:~\eclipse-SDK-4.0-win32>eclipsec.exe -application org.eclipse.equinox.p2.director -consoleLog -noSplash -repository http://download.eclipse.org/eclipse/updates/4.0,http://download.eclipse.org/e4/updates/2010,http://download.eclipse.org/releases/helios -installIU org.eclipse.releng.tools.feature.group,org.eclipse.emf.sdk.feature.group,org.eclipse.e4.ui.css.source.feature.feature.group,org.eclipse.e4.ui.source.feature.feature.group,org.eclipse.e4.ui.css.feature.feature.group,org.eclipse.e4.ui.feature.feature.group,org.eclipse.e4.core.tools.feature.feature.group
Wow, really impressive! Finally a thread for RCP programming. I feel I’m starting to get a fan of e4 – even at this early stage. Thanks a lot for the tutorial and additional information!
On Page 6, I could not find the Plugin.xml. Should I create one?
-Thanks much
If you have the MANIFEST.MF open you can click on the Extension-Tab on the bottom and the add and the “org.eclipse.core.runtime.products”-extension point
Thanks for the response, the ‘new->other->e4′ does not provide the options for the ‘plugin.xml’ or ‘application.e4xmi’ or ‘.product’ file.
Also, when I had the MANIFEST.MF file open in the default editor, I could not see the extensions tab.
So, I created a brand new project, this time used the wizard and then I copied the plugin.xml from the new project to the old project, searched and replaced the project names.
Then when I open the MANIFEST.XML, I could see the ‘extensions’ tab.
Since the ‘new->other’ is not helping me in generating the .e4xmi and .product file, I had to copy them from the new project, and I am at page 10, but when I click runas -> java app, nothing happens.
Is my download from the eclipse.org not the right one? I did update the e4tools from the help-> install new software, but it looks like limited functionality. is the a seperate bundle somewhere to download as a whole?
-thanks a lot
You can’t run this as a Java-App because you need to have a Equinox-Application.
I do appreciate your effort to write this tutorial (I really do), but its current version is simply useless. It just doesn’t work with the Eclipse 4.0 SDK that was released a week ago.
First, as others pointed out, when you get to the bottom of page 6 there is no plugin.xml created in the project. I was able to find the Extension Points link in the Overview tab of MANIFEST.MF, but when I press it and go to Extension Points -> Add, it is not apparent to me what to put in those fields (Extension Point ID, Name, Schema). If I put “product”, “org.eclipse.core.runtime.products” and leave the schema intact, I get a SWTException. If I edit the plugin.xml with the text editor and paste the sample from the PDF it is still the same.
If I put this problem aside and continue the tutorial, the next road block is on the next page, 7. When I create the Application Model and press finish, I get “‘Setup’ encountered an error” message with a NPE in the details.
Either I am really stupid, or the SDK and the tutorials are far from ready for any kind of adopters. Sad but true.
Thanks for your feedback and I’m sorry that you find it and the 4.0 SDK useless. I’ll try rework this section to clarify this point.
Beside that you are using the wrong “Tab”. You’ll have to use “Extensions”-Tab and not “Extension Points” – that’s exactly the answer I gave to another comment! I don’t know what you installed and if you got an NPE I’d have hoped you filed a bugzilla with the details attached without seeing at least a stacktrace I can only say that it works on my installation, maybe you have installed the visual designer which doesn’t work but that’s something I can’t influence because its not written by me. Without getting stacktraces and bug reports we can’t fix your problems.
You can also get help at the e4-newsgroup if you are not comfortable filing bugs. You need to understand that you are working with a bleeding edge kind of framework which we are going to mature in the year to come.
I’ve now clarified the section on the plugin.xml and added a warning to NOT install an XWT-Workbench-Tooling stuff which at least doesn’t work for me.
I tried again, with the latest version of the tutorial and taking your advice into consideration and it works! Thanks!
It must have been the XWT that was causing the main problem – this time I took the SDK and only installed the E4 Tools, as you suggest and it works fine.
A couple of suggestions, that I believe will make the tutorial even better:
1. On page 6, in the initial version of the plugin.xml, the root element is missing from the sample code.
2. On page 11, when starting the mail application for the first time, it would be nice to point out that you should select the product file and then Run As -> Eclipse application. My first attempt was by selecting the project and it didn’t work as I expected – new Eclipse instance was started.
Thanks again! And sorry if my first comment was a bit harsh. I am playing with e4 in my spare time and it was really annoying not to be able to get it to work (after a hard day at work
).
Thanks Stefan – I/we (the whole e4-team) appreciate any feedback and incooperate it into the tutorial. To your suggestions:
About the first one, the Create a plugin.xml section on page 6 – I probably didn’t explain it clearly.
The problem is that the sample XML after Add a product definition like this misses the root element for a plugin.xml file, the plugin element. It starts with an extension element instead.
The latest PDF-version holds a complete plugin.xml:
<?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <extension id="product" point="org.eclipse.core.runtime.products"> <product application="org.eclipse.e4.ui.workbench.swt.E4Application" name="Mail App"> </product> </extension>When I use the sample XML, I get a “Invalid root element” error in the editor. But when I put plugin element around the extension element, like this:
everything seems to be fine. That is why I suggested a change in the tutorial.
Ooops, the sample code didn’t show up. Retry:
You are right – fixed the plugin.xml to hold the plugin-element in the root
Hello
Sorry for my English school.
Excellent tutorial.
Besides the keyboard shortcut section untreated( ExitHandler + DirectMenuItem), no problem with eclipse-SDK-4.0-win32 and all Java code.
Page 29 of the tutorial should specify one Add -> Dependencies -> org.eclipse.e4.core.di.extensions.
Thank you,
Thanks for your info the info. On the KeyBinding stuff did the explanation not work for you? Should I improve it in some way (e.g. more screenshots?)
I’ve fixed the missing dependency information and pushed a new version to the git-repo. Thanks for the feedback!
Sorry for the confusion, I have not dealt with the keyboard shortcut section for personal reasons (FOR ME not interesting).