Skip to content

EclipseCollections

Dirk Fauth edited this page Jan 5, 2026 · 1 revision

Eclipse Collections

NatTable internally uses Eclipse Collections Primitive Collections to reduce the memory footprint and improve the performance. A more detailed explanation can be found in NatTable + Eclipse Collections = Performance & Memory improvements ?

The minimum required version of Eclipse Collections is 11.1.0.

Eclipse Collections are separated into two jars:

  • eclipse-collections-api
  • eclipse-collections

Internally Eclipse Collections are using the Java ServiceLoader API. This means the API JAR uses Services that are provided by the implementation JAR. The ServiceLoader API by default only works if consumer and provider are using the same classloader. Therefore it did not work in an OSGi context before Eclipse Collections 12.0.0. Since version 12.0.0 the support for using the OSGi Service Loader Mediator was added via [OSGi] Opting in to Service Loader Mediator.

This change has an impact on creating a runtime that contains NatTable. Since NatTable 2.6.0, the NatTable update site does not contain the dependencies itself anymore. Instead it contains links to the repositories that were used to create the release. By doing this the NatTable update site got much smaller, and consumers do not consume unwanted dependencies by accident anymore.

Although PDE should be able to resolve the Eclipse Collections dependency automatically via references, there might be issues if it is not declared explicitly in the target definition. It is therefore recommended to add the Eclipse Collections dependency explicitly.

You have the following options:

Since Eclipse Collections 12.0.0 the API and the implementation bundle can be consumed separately in an OSGi environment, as these bundles are prepared for the OSGi Service Loader Mediator. But that means that it needs to be part of the runtime and automatically started in order to make Eclipse Collections work in an OSGi environment. This can be done by adding Apache SPI Fly to the runtime and autostart it.

The NatTable Target Platform Defintion is an example on how a update site that consumes Eclipse Collections and Apache SPI Fly could look like.

The NatTable Example Eclipse 4 Product Definition shows how that configuration needs to look like for an Eclipse application.

Clone this wiki locally