This is the documentation of the Eclipse Equinox Framework.
Execution Environments (EEs) are a key concept in OSGi that describe the capabilities of the Java runtime environment. They define which Java packages and classes are available to bundles and help ensure compatibility between bundles and the runtime environment.
An Execution Environment is a specification that:
Bundles declare their required execution environment in their MANIFEST.MF:
Bundle-RequiredExecutionEnvironment: JavaSE-17
Or using Bundle-RequiredCapability (OSGi R7+):
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=17))"
| Execution Environment | Java Version | Description |
|---|---|---|
| JavaSE-21 | Java SE 21 | Java SE 21 LTS |
| JavaSE-17 | Java SE 17 | Java SE 17 LTS (current Eclipse minimum) |
| JavaSE-11 | Java SE 11 | Java SE 11 LTS |
| JavaSE-1.8 | Java SE 8 | Java SE 8 LTS (deprecated in newer Eclipse) |
| Execution Environment | Java Version | Status |
|---|---|---|
| JavaSE-1.7 | Java SE 7 | No longer supported |
| JavaSE-1.6 | Java SE 6 | No longer supported |
| J2SE-1.5 | Java SE 5 | No longer supported |
| J2SE-1.4 | Java SE 1.4 | No longer supported |
| J2SE-1.3 | Java SE 1.3 | No longer supported |
Execution Environment definitions are stored as .ee files in the Equinox framework. These files define:
Example JavaSE-17.ee structure:
# Java SE 17 Execution Environment
-Djava.specification.name=Java Platform API Specification
-Djava.specification.version=17
-Dosgi.java.profile.name=JavaSE-17
# System packages
org.osgi.framework.system.packages = \
java.lang,\
java.lang.annotation,\
java.lang.invoke,\
java.lang.module,\
java.lang.ref,\
java.lang.reflect,\
java.io,\
java.net,\
java.nio,\
java.util,\
javax.net,\
javax.net.ssl,\
# ... more packages
EE files are typically found in:
org.eclipse.osgiorg/eclipse/osgi/internal/framework/EquinoxConfiguration.javaBundles can specify multiple acceptable execution environments:
Bundle-RequiredExecutionEnvironment: JavaSE-17, JavaSE-11
The bundle will run if any of the specified environments are available.
Execution Environments follow Java’s backward compatibility:
The OSGi framework automatically detects the JVM’s capabilities and configures the appropriate execution environment. However, you can override this:
eclipse -vmargs -Dosgi.java.profile=file:/path/to/JavaSE-17.profile
osgi.java.profile=file:/path/to/JavaSE-17.profile
For testing or special scenarios, you can create custom EE files:
.ee file with required packages and capabilitiesosgi.java.profile system property| Aspect | Execution Environment | Java Version |
|---|---|---|
| Scope | OSGi framework concept | JDK/JRE version |
| Purpose | Bundle compatibility | Runtime capabilities |
| Granularity | Package-level | Version-level |
| Flexibility | Can be customized | Fixed by JDK |
Different Eclipse versions require different minimum Java versions:
| Eclipse Version | Minimum Java | Recommended Java |
|---|---|---|
| 2024-03+ | Java 17 | Java 17 or 21 |
| 2022-09 to 2023-12 | Java 11 | Java 17 |
| 4.7 to 2022-06 | Java 8 | Java 11 or 17 |
| 4.6 and earlier | Java 7 or 8 | Java 8 |
In eclipse.ini:
-vm
/path/to/java17/bin
-vmargs
-Dosgi.requiredJavaVersion=17
The -Dosgi.requiredJavaVersion property ensures Eclipse fails fast if launched with an incompatible Java version.
When developing bundles:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: My Bundle
Bundle-SymbolicName: com.example.mybundle
Bundle-Version: 1.0.0
Bundle-RequiredExecutionEnvironment: JavaSE-11
Import-Package: org.osgi.framework;version="[1.8,2.0)"
Use tools to validate EE compliance:
diag <bundle-id>In the OSGi console:
# Show framework properties
getprop
# Look for:
osgi.java.profile
osgi.java.profile.name
java.specification.version
# Diagnose bundle resolution
diag <bundle-id>
Enable resolver logging in .options file:
org.eclipse.osgi/resolver/debug=true
org.eclipse.osgi/resolver/ee=true
-Dosgi.requiredJavaVersionJava 9+ introduced the module system:
Bundle-RequiredExecutionEnvironment to Require-Capability# Old style
Bundle-RequiredExecutionEnvironment: JavaSE-17
# New style
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=17))"