Eclipse Yoxos Services Downloads Blogs About
Home > Blogs >

on Apr 2nd, 2009OSGi Execution Environment Validation

Execution Environments (EE) are a neat concept within OSGi, however, things can become complicated when developing against multiple EEs. For a real world example of what I mean, this weeks integration build in Eclipse was delayed due to an EE issue. A new bundle (org.eclipse.equinox.p2.repository) was added to the Eclipse SDK that declared an execution environment of J2SE-1.4 but used methods from J2SE-1.5 environment. This is really easy to do when you’re using a 6.0 JRE but developing bundles that should run on a 1.4 JRE. I mean, it isn’t that hard to use a new method from java.lang.String or java.lang.Double that you didn’t know about it.

Well, I’m happy to report that these types of problems should never happen again if you use PDE API Tools. In Eclipse 3.5, the PDE team added support for execution environment (system library) validation. To enable the validation support, simply go to the Plug-in Development->API Compilers Errors/Warnings preference page:

apitoolspref 300x243 OSGi Execution Environment Validation

Now that you have system library validation enabled, you should see cool warnings like this in your workspace:

apitools 300x62 OSGi Execution Environment Validation

All I can say is that I highly recommend you use PDE API Tools if you’re developing OSGi-based applications with Eclipse. If you find any issues or have suggestions, please let the team know by filing a bug.

Related posts:

4 Responses to “OSGi Execution Environment Validation”

  1. What?! Again only the workspace properties?

  2. I’m not sure what you’re asking Eugene. You can enable system library validation on a per-project basis if you want.

    You can also run the validation in a headless fashion using an ant task.

  3. Ah-ha. The screenshot you posted suggested that configuration is global. I am really glad to see that it can be also configured per-project.

  4. Awesome!

    I have stumbled over this once or twice myself.

    Elias.

© EclipseSource 2008 - 2011