“Eclipse Rich Client Platform” book – Revised third edition available based on Eclipse 4.4

by Lars Vogel at May 22, 2015 12:04 PM

I’m happy to announce that the revisted third edition of the Eclipse RCP book is available. It has been updated to Eclipse 4.4 and contains lots of small corrections and clarifications. The update resulted in approx. 100 more pages.

Eclipse Rich Client Platform

by Lars Vogel at May 22, 2015 12:04 PM

Unit Testing with scripts in EASE

by Christian Pontesegger (noreply@blogger.com) at May 22, 2015 08:41 AM

In the company I work for we do lots of regression testing, mostly for interface testing of hardware devices. Therefore we needed a unit testbench similar to JUnit without the complexity of writing java code for our tests. So we implemented a simple Unit test framework for EASE.

Source code for this tutorial is available in the EASE scripts repository.

Step 1: Create a simple test script

Create a new Project in your workspace named JavaScript Unit Testing Tutorial. Create a new file Tests/Simple/01 Valid tests.js
// starts a simple test
startTest("empty", "an empty test case");
// ends a test

// start another test
startTest("no test code", "a test containing no assertions");
print("Hi from valid test");

// third test
startTest("valid assertions", "a test containing valid assertions");
// check

// code outside of a testcase
print('"' + getTestFile() + '" completed');
You might ask where these test functions come from as we do not load any modules. The unit test framework comes with a module called Unittest. It is hidden by default but will be loaded automatically when we execute EASE UnitTests. To unhide go to the Preferences/Scripting/Modules (Note: this is not necessary to use the module, it will only display it in UI components).

If you are familiar with unit testing in general you also know assertions and according methods like assertTrue(). In general these methods perform a check for validity. In case an expected result does not match with a current result, an error is generated for the containing test case.

So test cases are encapsulated between a startTest() and an endTest(). It is recommended to not use assertions outside test cases, yet not mandatory.

Step 2: Create and execute a test suite

To execute test files, we need to create a Test Suite, that sets up a test environment for us. Create a new Scripting/Script Testsuite named Testsuite.suite.  The editor will allow you to select test files you want to execute. Therefore we look for script files in the same project where the suite is located.

Select our previously created test file and hit the Run Test Suite button in the top right corner.

 A new view is opened that displays unit test results.

The top tree view reflects the file structure of our test files and displays decorators indicating the test execution result. If you select a test file, detailed results are displayed in the bottom section.

Step 3: Test errors

Create a new file Tests/Simple/02 Test errors.js.
// test containing assertions that fail
startTest("invalid assertions", "a test containing invalid assertions");

// manually create a failure
startTest("failure", "test throwing a failure");
failure("test broken, stop execution here");

// an exception would also create a failure
throw new java.lang.Exception("code exception");

startTest("never to be reached");
// not being reached as the failure above terminates test file execution
Save the test, add it to your suite and run the suite right away. When an assertion fails, error markers are generated on your script files on the according code location. You will also see the most critical assertion reflected in the Script Unit Test view. Double clicking on errors will open the source editor on the corresponding location.

Similar to JUnit there exist two different types of things that can go wrong: errors and failures. Errors are assertions that do not meet their criteria. They are recoverable, meaning script execution of the test file continues.

Failures on the other hand are not recoverable, so script execution of that test file is terminated immediately.

Step 4: Test Suite configuration

Typically tests need to be adapted to a certain environment. In general you do not want test engineers to modify your script code. So the test suite supports setting of Variables that are automatically available in all test files. The Setup section allows to execute arbitrary code on the Test Suite start, Test File start, startTest() call and also for the corresponding teardown sections. As you may provide multiple suite files within a project, these secions are a good place to adapt tests according to your environment.

Optional: Test automation

Often tests need to be executed automatically, eg for a nightly test run. The Unittest module allows to run a testsuite from a script. Together with the headless application from EASE you can run a suite from the commandline and create a report (we currently support the JUnit xml format that can be picked up from Hudson/Jenkins).

Optional: Additional assertions

If you want to provide your own assertion methods, simply create your own module and let your wrapped method return an IAssertion. If you call your method from within a test script it will automatically validate your assertion method.

So why do I want to write scripted tests?

In the company I work for we use these kind of tests for interface verification of hardware devices. Therefore we provide our own modules that allow us to send stimuli and validate expected responses. We also use it in combination with analog measurement devices to verify that certain hardware parameters are within valid ranges.

Currently Script Unit Testing is supported for the Rhino script engine only.

by Christian Pontesegger (noreply@blogger.com) at May 22, 2015 08:41 AM

My favourite free Mac OSX apps

by David Bosschaert (noreply@blogger.com) at May 21, 2015 01:11 PM

I have been a Windows guy for many, many years, starting with Windows 2.x in the late 1980's all the way up to Windows 7. Then, about 4 years ago I gave up. Not because Windows was so bad (I actually quite liked Windows 7) but because at the time I could not find any decent laptop for it! So I got a Mac in 2011. And, over the years I got to like it, especially the hardware. I was always a big fan of opensource and freeware/shareware which was always widely available for Windows. Over the past years a collected some good legal free software for the Mac and I thought I'd share with everyone what I like. The interesting bit here is that most of this stuff is not actually distributed via the Apple Appstore...

Here's my list in no particular order, starting with a bundle of freely available utilities...


Great video converter tool. Convert any videos that you might have into any other format. BTW if you're looking for good settings that give you videos that play/stream on most devices and are relatively modest in size, I use the following settings (everything not mentioned is left at default):
  • Format: MP4, Web Optimized
  • Picture: Size: source = destination, Cropping: automatic, Anamorphic: none, Filters: all off
  • Video: Codec: H.264, FPS: Same as source-variable, Quality: RF 22, Use Advanced Options
  • Audio: AAC Stereo, Samplerate auto, Bitrate 128
  • Advanced: Reference Frames: 6, CABAC Entropy Encoding: yes, 8x8 transform: yes, Weighted P-Frames: yes, Subpixel ME & Mode: 2  SATD qpel, Trellis: off, No DCT Decimation: off.
Download from http://handbrake.fr.


The video player that plays everything. If you install the right drivers it can even play Blu Ray discs, something the native DVD player on OSX cannot do. Download from http://www.videolan.org/vlc.


Previously called XBMC. Another media player. This one is really good for streaming over the network and has tons of plugins. You can also create a catalog that runs on a central server and stream that to all the devices in your house, for example. I wrote some details on how I use my Raspberry PI as such a media server here: http://coderthoughts.blogspot.com/2014/01/how-i-learned-to-stop-worrying-about.html. Download from http://kodi.tv.


This tool has a lot of features for the touchpad, but the main reason why I use it is not on the touchpad. I don't like the click feature of the touchpad, the fact that you have to press the touchpad itself. I prefer pressing a button to act as a mouseclick. On my UK keyboard there is a key that I never use, just above the TAB key there is a key with the § sign. The above screenshot shows how I used the BetterTouchTool to remap that key to be the mouseclick. I still use the trackpad to position my mouse, but no need to press it down, I do that with my other hand by pressing that mapped key. Download from here: http://blog.boastr.net
BetterTouchTool also has Windows 7-like window snapping functionality, which is really handy too. Although I personally use Breeze for that, which has more features in this area. It's not a free tool so it doesn't belong in this list, but its very cheap so worth checking out :)


This is a very handy little tool, that simply extends the clipboard with a history of up to 25 entries. Instead of cmd-V, use shift-cmd-V to cycle through all your past clipboard contents. Extremely useful. This one is free on the apple appstore: https://itunes.apple.com/ie/app/flycut-clipboard-manager/id442160987?mt=12.


This is a free WinZip-like tool for the Mac. It doesn't have as many features as WinZip, but I tend to find it very good for quickly peeking in a .zip or .jar file. And the program icon is just really cute! Download from: http://www.zipeg.com.


I'm a VIM guy and this Mac version is really good! Download from https://code.google.com/p/macvim.


I'm relatively new to password management software but the recent vulnerabilities and attacks made me move to it. I'm a bit weary of storing my passwords in a cloud-based solution. I'd rather have a local file that's properly encrypted, so that it doesn't matter who actually sees that raw file. I also want something that automatically works with web browsers so that passwords are automatically entered. KeePass is a great Windows-based app that does all that. There's an Android version (KeePassDroid) that even works on my BlackBerry Z10. And there are Chrome (chromeIPass) and Firefox (PassIFox) integrations with the KeePass HTTP server that seamlessly enter your passwords in the appropriate websites if you approve this action.
There are a number of opensource projects to get this working on the Mac too. However, they seem to be in various stages of incompleteness. There is the KeePassX project, but it doesn't have support for the HTTP server (yet) that you need to integrate with the browser. There is a new project called MacPass which is another KeePass clone, but it also doesn't support the HTTP server (yet). Some people use Mono to run the Windows KeePass on OSX, but I found that not very satisfying and at some point it just started crashing continuously. In the end I found Keith Bennett's fork of KeePassX 2.0Alpha5 that has HTTP server support. The UI is a bit buggy, but it's the best I could find in the opensource arena for password management on OSX, so this is what I'm using right now. Looking forward to having a more stable version of KeePass on the Mac with HTTP server support.

PDF Split and Merge

I love PDFs :) (hey I work for Adobe). And there are tons of tools available for creating PDFs both from Adobe and from other vendors. PDFSam is a really nice little tool that helps you work with PDFs once they are created. Rearrange pages, split chapters off, merge multiple PDFs together, that kind of thing. I find myself using this tool pretty often. You can get it from here: http://www.pdfsam.org.

OSX Screen Saver runner

Ok, should maybe not be in this list, because it's not freeware or opensource, as it's shipped as part of OSX itself but it's free in that everyone who has OSX already has it, but you may not be aware of its existence. This is just a really simple way to lock your screen, if you need to walk away from your computer, for example. You simply find it on your local disk at /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app
and I normally have it locked to my dock, so I can just click it to lock my screen.


There are also a few larger applications where I think there are some great opensource products available that I use on a daily basis.

Openoffice / Libreoffice

Personally I prefer this office suite to the commercial ones available. Great features, great usability and it works on all the platforms that I use outside of OSX, including Linux. Download from https://www.openoffice.org.

Thunderbird and Firefox

These two need no further introduction. Just an excellent webbrowser and a great email client. Get them at https://www.mozilla.org.


Still the best IDE around for Java and other programming languages. Available from http://www.eclipse.org.

That's it - these are my favourite opensource / freeware / shareware apps that I use all the time. Enjoy :)

by David Bosschaert (noreply@blogger.com) at May 21, 2015 01:11 PM

Code editors in general with JavaFX

by Tom Schindl at May 20, 2015 11:17 AM

Yesterday I did a short demo on how one can build code editors with JavaFX while the talk was at Xtextcon most information apply to any code editor you may want to develop with the runtime components developed as part of e(fx)clipse.

I’ve uploaded the slides to slideshare

The important point is that all this is plain Java! No OSGi involved so eg the Java-Sample I showed looks like this:

public class SampleJavaCode extends Application {
  private final static String[] LEGAL_CONTENT_TYPES = new String[] { 
    IJavaPartitions.JAVA_STRING, IJavaPartitions.JAVA_CHARACTER };

  private int count = 0;

  public void start(Stage primaryStage) throws Exception {
    BorderPane container = new BorderPane();
    Document document = new Document();

    JavaSourceConfiguration configuration = new JavaSourceConfiguration();

    SourceViewer viewer = new SourceViewer();

    FastPartitioner partitioner = new FastPartitioner(new FastJavaPartitionScanner(), LEGAL_CONTENT_TYPES);
    document.setDocumentPartitioner(configuration.getConfiguredDocumentPartitioning(viewer), partitioner);


    Scene s = new Scene(container);

  public static void main(String[] args) {

and looks like this:



All sources for the stuff I presented are available in the e(fx)clipse git repository – watch out for projects starting with “org.eclipse.fx.xtext”.

by Tom Schindl at May 20, 2015 11:17 AM

My Journey to Mars, Eclipse Mars

by Doug Schaefer at May 18, 2015 06:05 PM

Wow, Eclipse Mars is almost finished and it’s been very busy for me and those I’ve been working with. We have a lot of exciting new features coming and I can’t wait to get them into the community’s hands and see where they take them.

I’m going to write more over the next few weeks on each of these, but I thought I’d give an overview of what you can expect for Mars. They all stem from a common theme, make Eclipse easier to use and lower the barrier to entry for new users, especially those writing C and C++ as a hobby, the new breed of hobbyist computer engineers using $10 computers to build amazing electronics projects. New users mean a growing and vibrant community.

Here are the highlights.

Serial Port Library

CDT has a pretty interesting native library that provides interfaces to native tools that the Java run-time doesn’t. This includes a Process subclass called Spawner that can send Unix signals, a Pseudo TTY interface (PTY) that can be used to set up terminal like interfaces to processes, and access to the Windows Registry.

One thing that is really common with these new $10 computers, especially the microcontrollers like Arduino is that you need to connect to them with a serial port to see what’s going on. For whatever reason, the serial port libraries out in the open were all GPL/LGPL and the main one, rxtx, has disappeared. Serial port programming isn’t rocket science, so I wrote my own library and added it to the CDT native feature. My first use is with the Arduino CDT covered below.

Remote Target Management

As I was building the LaunchBar (coming up next), I needed a way for the user to select which system to launch on. I made one that was pretty simple that adapted the targets such as those we were using for QNX and BlackBerry. I then started adding features, like a View to interact with the targets and then thought about a services architecture that would add command shells, remote launching, remote file access, i.e., a full blown target management system.

Well, that reminded me of Greg Watson (from PTP fame)’s talk from a few years ago about the fact we have too many target management systems, and none of them do everything we need. So he started one that does. I decided instead of writing my own, I’d add my vision to Greg’s and come up with an uber flexible, services oriented target management system. The beauty is that it’s easy to adapt to any existing TM system. And we’ll continue to build out features and make it a suitable replacement for RSE in upcoming releases.

Screen Shot 2015-05-18 at 1.56.06 PM

The LaunchBar

The LaunchBar has been the focus of my team at QNX’s efforts to fix up one of the biggest usability issues we see with Eclipse, the whole mechanism to launch the applications you’re building with the IDE. There’s been some work to improve that over the years, such as the launch shortcuts, but frankly, other IDEs do a much better job at this.

We felt it was important for the user to know exactly what was going to happen when they hit the run button. And that’s accomplished by showing the current selection, i.e. What you’re going to launch, Where you’re going to launch it to, and How you’re going to launch it. How is simply the launch modes we’ve had in the past but make more accessible. The Where relates to my work with the Remote TM system. In this day with embedded targets and cloud servers, we’re often building software that’s going to run somewhere else than our desktops.

The most important aspect what helping the user define What they’re going to launch. And really, my objective here was to make it so that the user never needs to go the the launch configuration dialog for the most common cases. To help with that, we have an automated system the populates potential What’s. By default, launch configurations are a What, obviously, and that makes the launch bar usable with existing launch configurations. But the system is flexible, and What’s can be anything, for example, Arduino projects.

Screen Shot 2015-05-18 at 2.00.03 PM

Arduino C++ IDE

My first foray into the hobbyist computer engineer world was with Arduino. I bought an Arduino Uno and built a little system with a sensor and a wifi shield that was a kind of Internet of Thing. But after years of using professional IDEs, the last many being Eclipse, I wasn’t very excited about the standard Arduino IDE. Also, Arduino programming is done through this language called Wiring which, come on!, it’s so close to C++, why not teach hobbyists those last two or three concepts and “Program Your Arduino in C++ Like a Pro”.

And, hey, I know this great C++ IDE they can use. So, and this is the self serving part, I set out to build an integration for the Arduino toolchain for CDT. And it turned out pretty nice and I enjoy using it for my Arduino projects. And as a bonus, I get to use the same IDE, hell, same workspace, to program the server side of my Internet of Thing project. For me, that has always been the promise of Eclipse: One IDE to rule them all!

I have the plug-ins in CDT and they’ll be coming out in Mars. It’s really only a preview at the moment and you’ll need to have the standard Arduino IDE installed for it to work. As I was wrapping up the Mars work, Arduino released their 1.6 version and with it and pretty nifty library and BSP management system with an open data format. I plan on adding support for that system to the Arduino CDT plug-ins as well and that should eliminate the need to install the Arduino IDE if you so desire.

The Journey Continues

As I mentioned, I’ll write a lot more about these features in the upcoming weeks. It’s going to be hard to try them without a little documentation and that will come here on my blog for now until things mature. There’s a lot more ahead as I get feedback from the community and people try to use these things in different configurations. I already have great feedback from the Red Hat JBoss guys who are trying to use the LaunchBar for WTP that’s resulted in a pretty big last minute change. But this stuff is only successful if people use it and contribute back so I’m more than willing to listen.

Also my journey into the computer engineer hobbyist world continues beyond Arduino. I have a Raspberry Pi B and I have been able to build an ARMv6 hardware float toolchain for it. We’ll likely make this the first official embedded target support provided by the CDT as an example for the embedded vendors to follow. We should have done that a long time ago.

I’ve also just purchased a couple of ESP8266 chips. They’re little microcontrollers inside a wifi chip with a healthy number of GPIO pins, all for $10 or less. The Chinese company that makes them has put out a pretty good SDK and the toolchain is again standard GCC. I need a CDT integration for these too :).

I mentioned in my note about EclipseCon that I think this is probably the most exciting time to be in the Eclipse community since they early days. So many new features and great work being done by a diverse team of really smart people has breathed some much needed new life into our favourite IDE.

by Doug Schaefer at May 18, 2015 06:05 PM

Eclipse DemoCamp “Mars” Vienna

by Florian Pirchner at May 18, 2015 10:32 AM

Lunifera GmbH and IoT-Vienna are organizing the Eclipse-DemoCampMars” on 19.6 2015.

With this event, we want to bring people and companies together to share their knowledge, experience with and about Eclipse. This meeting includes six Talks and a quick intro on the Eclipse Foundation’s role by Benjamin Cabé.


  • Tom Schindl: Something cool TBD
  • Werner Keil: Energie Sparen präzise Messwerte bei SmartHome und SmartGrid
  • Philip Langer: EMF Compare
  • Benjamin Cabé: IoT Talk
  • Florian Pirchner: OSGi-IoT-Vaadin

We also provide catering, drinks, beer and cakes as usual.

For details please visit http://edcvienna.org/#home

Hope to see you at the DemoCamp “Mars” Vienna…

the DemoCamp organizers

by Florian Pirchner at May 18, 2015 10:32 AM

Shared blog for EclipseSource Munich

by Jonas Helming at May 18, 2015 10:29 AM

As Maximilian already announced on his Blog: To make it simpler for you to follow our blog posts from EclipseSource Munich we will now use a joint blog for all topics related to our work in Munich. This means there will be less posts that appear on my blog since I will post many things on the new Blog. All posts on the new blog are announced on the Twitter Account and Google+ page, see details below:

New Blog: http://eclipsesource.com/blogs/author/helmingkoegel

Twitter: https://twitter.com/EclipseSourceM

Google+: https://plus.google.com/105940428433807258305/posts

See you on the new blog!


Leave a Comment

by Jonas Helming at May 18, 2015 10:29 AM

EMF Forms: Beyond SWT

by Maximilian Koegel and Jonas Helming at May 18, 2015 09:33 AM

EMF Forms makes it really simple to create forms to edit your data based on an EMF model. We have recently released EMF Forms 1.5.0. To get started with EMF Forms please refer to our tutorial.

Besides saving a lot of effort when comparing to manual UI development, EMF Forms provides an additional benefit for free: UI technology independance. EMF Forms uses a technology independent language to describe the UI (View model). This model is interpreted by a rendering component to create a UI during runtime. By enhancing or replacing the existing renderer, the UI can be adapted to project specific needs. The default renderer are written in SWT, however, it is fairly simple, to develop a renderer in another UI technology and thereby migrate all existing form-based UIs.

For 1.5.x, we have spent efforts to make the implementation of new renderers as simple as possible and we are happy that the number of supported UI technologies is growing.

Since the last release cycle (1.5.x), there is even an external contribution to EMF Forms providing a Vaadin rendering component that translates a View model to a form-based UI in Vaadin. This new renderer is also under active development

Additionally, we are working on a web renderer based on AngularJS. Please refer here for a complete list of available technologies and how to use them. The link also contains a new tutorial for how to use the available renderers.

If you miss a supported technology or if you are interested in one of the renderers under development, please contact us.


 image03  image05  image00

Android (using Tabris)

 image04  image01

Browser (using RAP)

Browser (using AngularJS) Browser (using Vaadin)


Leave a Comment. Tagged with eclipse, emf, emfcp, emfforms, eclipse, emf, emfcp, emfforms

by Maximilian Koegel and Jonas Helming at May 18, 2015 09:33 AM

EclipseCon France - Early registration deadline

May 17, 2015 02:23 PM

The early registration deadline is May 26. Register now!

May 17, 2015 02:23 PM

Great Fix Winners, Round Three

May 17, 2015 02:22 PM

Here are the final winners for the Great Fix. Thank you to everyone who contributed!

May 17, 2015 02:22 PM

Honored to become Eclipse PDE committer

by Lars Vogel at May 13, 2015 12:11 PM

I’m happy to announce that I was elected as PDE committer. This made the integration of the new png icons in PDE much easier. I plan to work on the PDE templates and improve the PDE tooling for the IDE and PDE extensions in the Eclipse Neon release.

by Lars Vogel at May 13, 2015 12:11 PM

Unravelling the container within the container within the container…

by Melanie Bats at May 13, 2015 07:12 AM

Last time in the Sirius blog post series, you learned how to create an artificial container, today we will see how to create an infinite hierarchy of containers.

As an example we will represent the different dream levels featured in Inception :

We need to model dream levels and that levels can refer to other sub levels :

We develop a first Flat representation to show all the levels at the same stage :

A Flat diagram is created and a Level container is defined to represent all the levels defined in the model :

Thanks to this representation we see all the different dreams but it is not possible to understand how they are interlinked.

Next step we create a SubLevel diagram to represent the first three dream levels :

A first container Level represents the reality, then we represent the second dream level thanks to the SubLevel container and finally the third level with another container named SubSubLevel.

For each container we retrieve the child level thanks to the levels feature defined in the metamodel. For each level container we define a new style.

The following SubLevel diagram results:

Defining for each level a new mapping and a new style is really painful and it determines the number of levels you can create. Fortunately, Sirius can help us to define an infinite hierarchy of elements.

Reuse mappings

We create a new Inception diagram as we did before, we define again a Level container to represent the initial level and then a SubLevel mapping models the second level.

At this point we are able to represent only the first two levels. To get an infinite hierarchy of levels, we need to set in the Import tab, the Reused Container Mappings field and select the SubLevel mapping. This means that the SubLevel mapping could define as descendant other SubLevel mappings. Here we reuse a mapping defined elsewhere in the VSM using the Reused Mappings property in the Import category. The effect at runtime is the same as if you had created an equivalent mapping inside the parent mapping.

We create a new Inception diagram and…It’s working like a dream! We see all the levels hierarchy.

Pay attention, as this method uses recursion, if you set the semantic candidates expression to eAllContents a stack overflow exception will occur.

Last point, using this method we need to define the style for the first level and then we set the same style values to the sublevel mapping in order that all the levels appears with the same look.

With Sirius you can define the level style just once.

Import mappings

A last Inception2 diagram is defined, with a Level2 mapping which is an exact copy of the previous Level mapping. We define also a style for this mapping.
Then instead of creating a New Diagram Element as we did in the previous diagram definition, this time we create a New Import Element.

The Semantic Candidates Expression is set to feature:levels

And in the Import tab, we set the Imported Mapping to Level2. This means that this new mapping reuses the style defined by the imported mapping.

The mapping imports are used to specialize an already defined mapping. In our example we override the Semantic Candidates Expression.
To get an infinite hierarchy of levels, we set again the Reused Container Mapping field to SubLevel2.

Then in this diagram definition the level style is defined just once:

If we create an Inception2 diagram we obtain exactly the same result as before :

With Sirius, make your dreaming designer come true!

The sample code from this example is available on github: https://github.com/mbats/sirius-blog/tree/master/reimport


by Melanie Bats at May 13, 2015 07:12 AM

Multithreaded JavaScript with J2V8

by Ian Bull at May 12, 2015 05:07 PM

J2V8 provides a tight binding between Java and the V8 JavaScript engine. Using JNI, you can execute JS scripts on V8, get and set values, register callbacks and invoke JavaScript functions — all from Java. However, because of the subtleties related to multiple threads, J2V8 requires that all interactions happen from the same thread. Because JavaScript itself is single threaded, this works out ok.

But what if you want to implement something like WebWorkers? You would likely create a new V8Runtime and execute a script on a separate thread — but this will fail! Starting with J2V8 3.0 you can now interact with J2V8 from different threads, with one rule: All interactions with a V8Runtime must be from the thread that instantiates the Runtime. This means that you can create a V8Runtime for each thread in the system, and each thread can interact with its own V8Runtime independent of each other. A snapshot release is currently available in Maven Central.


In short, it means you can now do this (although don’t forget to release the runtime when you’re done):

new Thread(() -> V8.createV8Runtime().executeScript("...")).start();

To test this, we created a merge sort that used separated V8Runtimes at each sort step. At each step, the list would be divided in half and two new V8Runtimes were created. Each V8Runtime executed the merge sort algorithm in parallel, and the results were merged together. Just for fun, we ran 10 parallel merge sorts.

function sort(data) {
  if ( data.length === 1 ) {
    return [data[0]];
  } else if (data.length === 2 ) {
    if ( data[1] < data[0] ) {
      return [data[1],data[0]];
    } else {
      return data;
  var mid = Math.floor(data.length / 2);
  var first = data.slice(0, mid);
  var second = data.slice(mid);
  return merge(_sort( first ), _sort( second ) );

We managed to remove all shared data structures between different instances of the V8Runtime, allowing the entire system to run without locks. This greatly improved performance.

The source code for the merge sort example is available on GitHub.

For more information on J2V8 and for future updates, follow me on Twitter.


Leave a Comment. Tagged with j2v8, j2v8

by Ian Bull at May 12, 2015 05:07 PM

Running Eclipse Mosquitto on Snappy Ubuntu Core

by Benjamin Cabé at May 11, 2015 10:34 PM

I’ve recently been playing around with Snappy Ubuntu Core, and I thought it would be a nice exercise to try and package Mosquitto as a so-called “Snap”.

This blog post will give you a quick introduction to Snappy, and what it means to have a technology like Mosquitto available as a snap package.

Snappy Ubuntu Core


Ubuntu Core is a minimal Ubuntu distribution, that doesn’t come with the classical, APT-based, package manager.
Ubuntu Core is targeting cloud & IoT environments, therefore it is using an approach where the applications or services that one installs in a given distro, are self-contained “snaps”, that are completely isolated from the rest of the environment. If a snap depends on a shared library, this library will be bundled with the snap. If a snap needs to be granted rights beyond the scope of their default sandboxed container, it will be specified in the snap metadata. And so on.

Why does it matter for the Internet of Things?

Being able to transactionally update a system definitely makes sense for cloud environments, but it is also key for Internet of Things solutions. Even more so if you take into account how easy it is to fire up a new EC2 machine for a system you just crashed, vs. actually going on the field to troubleshoot an IoT gateway that went off the network after a failed update…

Furthermore, IoT gateways today are operating a very limited set of services, since there’s no clean and safe way to really turn them into extensible platforms, where any partner involved in developing a given solution would be able to run its own bits, in dedicated sandboxes. Application frameworks like Kura certainly enable such things at the application level, but we need solutions like Ubuntu Core for anything closer to the system.

Mosquitto on Snappy Ubuntu Core

If you have ever played with MQTT, there’s a good chance that you have used Eclipse Mosquitto as your broker. It is a very customizable, feature-packed, broker that has recently added support for MQTT over WebSockets. Mosquitto is available in source form, but it is also distributed in binary form and as a ready-to-use package in many Linux distros.

The Mosquitto Snappy package contains a WebSockets-ready version of Mosquitto 1.4.2 that can run on x64 or ARM architectures. Therefore, you are literally 2 minutes away from having an up-and-running Mosquitto broker on Microsoft Azure, Amazon EC2, or Google Compute Engine. Since Ubuntu Core is also available for the Raspberry Pi and the BeagleBone Black, you can install Mosquitto on those platform as well.

If you want to try it yourself on EC2, for example, you can follow this tutorial to bootstrap your Ubuntu Core image. Once you have a shell access to your Core server, simply run sudo snappy install mosquitto.kartben, and Mosquitto will be automatically downloaded from the Ubuntu Software Store, and installed. WebSockets are enabled on port 8080 and as a matter of fact, I have also packaged a few extra resources with the broker to help you get started: if you open http://{myubuntucoreIP}:8080 in your browser, you will be granted with a web page that helps making sure you use the right connection settings, and also with a live visualization of your topics’ activity.


by Benjamin Cabé at May 11, 2015 10:34 PM

Using JYZ3D (and JOGL) in Eclipse RCP

by Maarten Meijer (noreply@blogger.com) at May 11, 2015 10:18 PM

As part of evaluating several 3D charting packages for use in Eclipse RCP Applications I needed to get JYZ3D (http://www.jyz3d.org) working on OSX.

Jzy3d is an open source java library that allows to easily draw 3d scientific data: surfaces, scatter plots, bar charts, and lot of other 3d primitives. The API provides support for rich interactive charts, with colorbars, tooltips and overlays. Axis and chart layout can be fully customized and enhanced. Relying on JOGL 2, you can easily deploy native OpenGL charts on Windows, Unix, MacOs (...) and integrate into Swing, AWT, or SWT. Various contributions have also made Jzy3d available for other languages/platforms such as Scala, Groovy, and Matlab.

JYZ3D is described as suitable for RCP but it requires some setup. I describe the process below in order to help others get results quicker.

First attempt

Using libraries in RCP requires packaging them in bundles and adding an OSGi MANIFEST so that they can be properly located as dependencies. As JYZ3D requires JOGL (http://jogamp.org/jogl/www/) I looked for ways to install JOGL easily on RCP, by converting it to a bundle. I found the tutorial by Wade Walker from 2010 that can easily be adapted to the latest version of JOGL meaning 2.3.1.

The first attempt resulted in a Exception: java.lang.UnsatisfiedLinkError: Can't load library: /System/Library/Frameworks/gluegen-rt.Framework/gluegen-rt


As JOGL uses some interesting class loader tricks, the main library requires an Activator to insert some extra logic on start up using JarUtil.setResolver().

The resulting Activator.java is as follows:

package jogamp.osgi;

import java.io.IOException;
import java.net.URL;

import jogamp.nativewindow.Debug;

import org.eclipse.core.runtime.FileLocator;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

import com.jogamp.common.util.JarUtil;

* The activator class controls the plug-in life cycle
public class Activator extends AbstractUIPlugin {

// The shared instance
private static Activator plugin;

* Returns the shared instance
* @return the shared instance
public static Activator getDefault() {
return plugin;

* The constructor
public Activator() {
public void start(BundleContext context) throws Exception {
JarUtil.setResolver(new JarUtil.Resolver() {
public URL resolve(URL url) {
try {
// System.out.println("before resolution: " + url.toString());
URL after = FileLocator.resolve(url);
// System.out.println("after resolution: " + after.toString());
return (after);
} catch (IOException ioexception) {
return (url);
plugin = this;

public void stop(BundleContext context) throws Exception {
plugin = null;


There was a change in the native code library naming conventions from Java 6 to Java 7 so you must unpack the *macosx-universal jars (jogl and gluegen), duplicate al *.jnilib files to *.dylib files and repack into the jars.

Once you have done this you can run Wade Walker's example view code.

JOGL Demo Wade WalkerI then downloaded jars for JZY3D 0.9.1 from Maven and created a bundle using Create Bundle from jar.

The result was a lot of errors about package javax.media.opengl not being found. JXY3D relies on a much older version of JOGL and despite it being a 2.x.x. version there is definitely a compatibility break here. So much for the adoption of proper semantic versioning.

Second attempt

I downloaded the source for JXY3D from GitHub from https://github.com/jzy3d/jzy3d-api importing them as Maven projects (important step) and built the jars as Maven projects.

These depend on a newer version of JOGL (2.1.5-01) but having learned my lesson about version compatibility I created new JOGL Library plugin using the jars for version 2.1.5-01. I downloaded these from Maven Central. Again fix the native library naming issue for macosx-universal versions.

The mechanism for finding the natives changes between JOGL versions, so here the solution is to put all native jars into the same bundle as the main library. Again add the above bundle activator, and, as this is a bundle with native jars in the root, add the bin/ folder with the Activator to the class path.


The final error purely on OSX was org.eclipse.swt.SWTError: Not implemented java.lang.ClassNotFoundException: apple.awt.CEmbeddedFrame>This can be solved using the magic found on stackoverflow: SWT_AWT.embeddedFrameClass = "sun.lwawt.macosx.CViewEmbeddedFrame";

The final Activator.java is as follows:

package jogamp.osgi;

import java.io.IOException;
import java.net.URL;

import jogamp.nativewindow.Debug;

import org.eclipse.core.runtime.FileLocator;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

import com.jogamp.common.util.JarUtil;

* The activator class controls the plug-in life cycle
public class Activator extends AbstractUIPlugin {

// The shared instance
private static Activator plugin;

* Returns the shared instance
* @return the shared instance
public static Activator getDefault() {
return plugin;

* The constructor
public Activator() {
public void start(BundleContext context) throws Exception {
if ("Mac OS X".equals(System.getProperty("os.name"))) {
System.out.println("Set SWT_AWT.embeddedFrameClass");
SWT_AWT.embeddedFrameClass = "sun.lwawt.macosx.CViewEmbeddedFrame";
JarUtil.setResolver(new JarUtil.Resolver() {
public URL resolve(URL url) {
try {
// System.out.println("before resolution: " + url.toString());
URL after = FileLocator.resolve(url);
// System.out.println("after resolution: " + after.toString());
return (after);
} catch (IOException ioexception) {
return (url);
plugin = this;

public void stop(BundleContext context) throws Exception {
plugin = null;


And then I can also run the example code for JYZ3D.

JYZ3D demo


  • Don't assume that everybody uses semantic versioning.
  • Be grateful for the people who take the time to answer questions on StackOverflow.

by Maarten Meijer (noreply@blogger.com) at May 11, 2015 10:18 PM

Welcome Dirk Fauth as a new eclipse.platform.ui Committer

by Lars Vogel at May 11, 2015 07:07 PM

I would like to welcome Dirk Fauth as new platform.ui committer. Dirk is the project lead of NatTable project and a very active contributor to several Eclipse projects. Dirk recently also won the Greatfix price and has indicated that he plans actively review contributions from the community via Gerrit.

Welcome Dirk!

See the message on the platform.ui mailing list.

by Lars Vogel at May 11, 2015 07:07 PM

Using the new Eclipse Installer

by Lorenzo Bettini at May 11, 2015 05:25 PM

I’ve just started using the brand new Eclipse installer, and I’d like to report my experiences here. First of all, a big praise to Ed Merks and Eike Stepper for creating Oomph, on which the installer is based. :)

First of all, the installer is currently available in the “Developer Builds” section:


Once you downloaded it and extracted it, just run the executable oomph:

eclipse-installer2If you see an exclamation mark (on the top right corner), click on it, you’ll see some updates are available, so update it right away, and when it’s done, press OK to restart it.

The very same top right corner, also opens a menu for customization of some features, the one I prefer is the Bundle Pool, a cool feature that has been in Eclipse for so many years, and so very badly advertised, I’m afraid!

“p2 natively supports the notion of bundle pooling. When using bundle pooling, multiple applications share a common plugins directory where their software is stored. There is no duplication of content, and no duplicated downloads when upgrading software.”

One of the cool things of Oomph is that it natively and automatically supports bundle pools, it makes it really easy to manage them and makes installation faster and with less space requirements (what’s already been downloaded and installed won’t have to be downloaded and installed again for further Eclipse installations).


If you select that menu item, you can manage your bundle pools; the installer already detected existing bundle pools (I’ve been using them myself, manually, for some time now, and it detected that):


For this blog post I will create another bundle pool, just for testing. To create a new bundle pool, you first need to create a new p2 agent; the agent is responsible to manage the bundle pool, and to keep track of all the bundles that a specific Eclipse installation requires (this is also known as a p2 profile).

So I select “New Agent…” and choose a location in my hard disk; this will also set a bundle pool:


Just for demonstration, I’ll select the “pool”, “Delete…”, and create a “New Bundle Pool…” for the new agent, in another directory:


Then I select the new bundle pool, and press “OK”.

From now on, all the installations will be managed by the new agent, and all bundles will be stored in the new bundle pool.

OK, now, back to the main window, let’s start installing “Eclipse IDE for Java Developers”

In the next windows, I choose to install the new Eclipse in a different folder from the proposed default:


Let’s press “INSTALL”, and accept the LICENSE, the installation starts:

eclipse-installer8You’ll see that the installer is really quick (as far as I know, Oomph improved p2 internal mechanisms). It only took about a minute to install this Eclipse on my computer.

Then, you’re ready to launch this installation, or see the installation log.

eclipse-installer9But first, let’s have a look at the directory layout:


you see that the installed eclipse does not have the typical directory structure: it has no “features”/”plugins” directories: these are in the shared bundle pool. Also note that the p2 agent location has a directory representing the profile of the installed Eclipse.

Let’s try and install another Eclipse, e.g., the “Eclipse DSL Tools” (what else if not the one with the cool Xtext framework? 😉

The dialog proposes an installation directory based on my previous choice; I also select “Luna” as the platform:


Let’s press “INSTALL”… WOW! This time it’s even faster! You know why: only the new bundles are downloaded, everything else is shared. This also means: less space wasted on your hard disk! :)

But there are cooler things: Bundle pool management!

Go back to the “Bundle Pool Management” dialog, select the checkbox “Show Profiles” and you see the profiles handled by the current agent:

eclipse-installer12Select the agent and press “Analyze…”

You can see the bundles used by which profile:

eclipse-installer13Hope you enjoy this new installer! :)





Be Sociable, Share!

by Lorenzo Bettini at May 11, 2015 05:25 PM

Docker on Windows behind a Firewall

by Kai Tödter at May 11, 2015 08:09 AM

Working with Docker under Windows becomes easier and easier. I am often ask by co-workers how to run Docker behind a firewall, this blog gives a little recipe, how to set up the whole Windows/Docker/Firewall environment.

  1. Install Virtual Box
  2. Download Docker Machine to manage your docker hosts
    • You find the Windows versions (32 and 64 bit) at above link
    • Rename the exe to docker-machine.exe
    • I would recommend putting the machine in a dedicated docker directory and update your PATH env variable
  3. Install the Docker Windows client
  4. Create a Docker host named ‘dev’ with docker machine
    • docker machine create --driver virtualbox dev
  5. Connect the Docker client with the docker vm
    • Saving the environment to a .bat file: docker-machine env dev > docker-env.bat
    • You will get something like
      export DOCKER_TLS_VERIFY=1
      export DOCKER_CERT_PATH=”C:\\Users\\kai\\.docker\\machine\\machines\\dev”
      export DOCKER_HOST=tcp://
    • In the bat file, change every ‘export’ to ‘set’ and remove the “” from the cert path
    • The bat file now looks like
      set DOCKER_CERT_PATH=C:\\Users\\kai\\.docker\\machine\\machines\\dev
      set DOCKER_HOST=tcp://
    • Run the bat file
    • Check if the client is working:
      • Run docker ps in a Windows cmd
  6. Prepare the proxy settings
    • SSH into the docker dev host: docker-machine ssh dev
    • Add the following lines to /var/lib/boot2docker/profile
      export HTTP_PROXY=http://<proxy>:<port>
      export HTTPS_PROXY=http://<proxy>:<port>
    • Exit the ssh session and restart the docker machine: docker-machine restart dev

Now you should be able to use Docker on Windows behind a firewall. To test it, open a Windows cmd and run
docker run busybox echo hello world

After docker has downloaded the busybox image you should see

hello world

That’s it :)
Now you can easily use all Eclipse or IntelliJ IDEA plugins that require a local Docker installation.

Flattr this!

by Kai Tödter at May 11, 2015 08:09 AM

Documentation Platform for Eclipse Scout

by Jérémie Bresson at May 08, 2015 03:59 PM

Developers often see the documentation as a non-urgent task. As a result, documentation always ends up at the end of the task list. For an open-source project this is a dangerous approach as having no documentation at all, and even bad/outdated documentation represents a serious obstacle for growing a community successfully.

Currently, the Eclipse Scout project has a historically grown documentation. In the past, several approaches have been tried (wiki with and without the version in the page name, a book, html files, conversion of the eclipse wiki to the eclipse help format…). Although this approach can be considered to be a valuable learning experience, the project is now faced with the challenge of having various documents with overlapping content and different formats. This also increases the necessary efforts to keep the documentation in sync with the current release.

For our tooling stack we have this vision:

  • Automation of everything that is possible
  • Single source: produce the different outputs reusing different modules (website, tutorials, books, eclipse-help…)
  • Extract the code listings from existing real applications in order to be sure that the development is up-to-date.
  • Use a git repository instead of a wiki to ease the maintenance on different branches.

Here is how our big picture looks like:

Eclipse Scout documentation workflow

Bug 465960 is an umbrella bug, where we track our activity in this domain.

With RC1 we will deliver an initial version of an “Eclipse Scout User Guide” (Eclipse Help format). This allows us to experiment with our toolchain based on Asciidoctor and some additional post processing steps.

Eclipse Scout User Guide

A first version of the same content is already live on our homepage.


The content of the “example pictured is realized in two adoc files, the HelloWorldFrontend.adoc and the HelloWorldBackend.adoc.

We would be happy to get feedback and questions in the corresponding forum thread.

Project Home, Forum, Wiki, Twitter

by Jérémie Bresson at May 08, 2015 03:59 PM

Great Fix Winners, Round Three

by waynebeaton at May 07, 2015 07:57 PM

My apologies for being late with this announcement.

We have four winners in this third and final round of the Great Fixes for Mars Skills Competition. In no particular order, I present the winners…

Tony McCrary contributed dozens (maybe hundreds) of new icons to multiple projects. The impact of these changes is most noticeable on the dark theme or a toolbar with a coloured background, but they also improve the appearance of the icons nicely on even a white background. There’s a brief mention (and example) in the new and noteworthy documentation for JDT 4.5M7.

This fix represents a considerable amount of work spanning multiple months, and plenty of interaction with multiple development teams in at least ten different bugs. Tony contributed SVG versions of each of the icons along with some tools for converting them to various forms which will be handy when we’re ready to generate images for HDPI.

Robert Roth contributed a number of fixes that improve the consistency of the user experience and stability of the platform. Robert’s contribution takes the form of a dozen small fixes that have a significant impact in aggregate. One fix, for example, makes the position of the “Apply” button in the launch configurations dialog consistent with the placement in other dialogs. His contributions also include some stability fixes.

Fabio Zadrozny spent a lot of effort to make CSS-based styling work with more widgets and improve the dark theme. This effort has resulted in hundreds of lines of new Java and CSS code that greatly improve the dark theme experience.

In keeping with the dark theme theme, our fourth winner Simon Scholz has also contributed a number of patches that make styling Eclipse easier and by extension improve the quality of the dark theme. Simon also contributed a new “presentation” theme that bumps up the font size in the IDE that’s useful for when you’re doing a demo in front of a group, and a patch that improves the stability of the platform by plugging a memory leak.

Congratulations to the winners! I’ll send out the prizes tomorrow.

Many thanks to everybody who participated! We’ll be in contact later this week to tell you how to get your Eclipse t-shirt.

Another thing that I have to do this week is sort out which committer did the most work reviewing contributions. I have one extra prize for them.

by waynebeaton at May 07, 2015 07:57 PM