Java 8 & Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))"

Jmini picture Jmini · Jul 10, 2014 · Viewed 44.2k times · Source

I have using Eclipse Luna win32.x86_64 runing with Java 8.

Here from the Help Menu > About > Installation Detail > Configuration Tab:

java.runtime.version=1.8.0_05-b13
java.version=1.8.0_05

I have created new plug-in project, requesting JavaSE-1.8 as Execution Environment:

Plug-in Editor. JavaSE-1.8 as Execution Environment

In the myplugin/META-INF/MANIFEST.MF file I have of course:

 Bundle-RequiredExecutionEnvironment: JavaSE-1.8

I use this plugin in a product file. When I try to validate it, I get following error:

Validations Dialog, opened from the product file editor

Of course if I start the product, I get:

!ENTRY org.eclipse.osgi 2 0 2014-07-10 08:14:22.042
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2014-07-10 08:14:22.043
!MESSAGE Bundle update@********/myplugin/ was not resolved.
!SUBENTRY 2 myplugin 2 0 2014-07-10 08:14:22.044
!MESSAGE Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".

I have tried to verify a lot:

Preferences > Java > Installed JREs

Installed JREs

Preferences > Java > Installed JREs > Excution Environments

Excution Environments

Preferences > Java > Compiler: JDK Compliance Compiler compliance level

Compiler

When I start the product, I checked in the Launching tab that I use the jre8 as execution environment.

I have even tried to change the Java Runtime Environment in the Run Configurations Dialog:

Java Runtime Environment

I have tried different settings. None of them works.


What is wrong?

Is it a known issue?

Answer

Christian Schneider picture Christian Schneider · Jul 10, 2014

The error means that your bundle has a Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))" entry in its manifest. So this means the bundle will only start when there is a bundle that provides this capability.

In case of the osgi.ee capability it is the OSGi framework (equinox) that should provide this capability. Apparently it does not do this.

So one approach would be to remove the header from you bundle Manifest. The other would be to make equinox export the capability. Perhaps you could simply try with the newest equinox version. Not sure if this helps though. You could also try to set the framework property (using -D): org.osgi.framework.system.capabilities=osgi.ee; osgi.ee="JavaSE";version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8"

See