Upgrading to Framework 8 (Java 25 Support)
Apache Felix Framework 8.0.0 makes the framework run on current JDKs, up to and including Java 25 (FELIX-6807). It is a deliberately breaking release: the OSGi security layer has been removed and the minimum Java version is now 11. The 7.x line remains available for users who need the security layer or Java 8, but it only receives critical bug fixes and no new features.
This page explains what changed, who is affected, and how to upgrade.
Which version should I use?
| 7.x | 8.x | |
|---|---|---|
Minimum Java version |
8 |
11 |
Runs on Java 24 and later |
no |
yes |
OSGi security layer |
supported |
removed |
|
|
|
-
Pick 7.x if you need the security layer, or if you must run on Java 8.
-
Pick 8.x if you need to run on Java 24 or later.
Framework 8.0.0 is built and tested in CI on Java 17, 21, 25 and 27. The OSGi Core R8 TCK was run on Java 17, 21, 23 and 25.
What changed
The OSGi security layer has been removed
Java SE 24 permanently disabled the Security Manager (JEP 486).
System.setSecurityManager throws UnsupportedOperationException and -Djava.security.manager=allow is a fatal startup error, so the framework can no longer install a Security Manager and no permission check can ever run.
Rather than appear to enforce permissions while silently enforcing nothing, the framework no longer implements the security layer at all.
In practice:
-
Launching with
org.osgi.framework.securityset now fails with aSecurityException. Previously the framework installed a Security Manager. A launcher that depends on security will refuse to start rather than start unprotected. -
Bundle.hasPermission(Object)returnstrueunless aSecurityProviderhas been installed explicitly. -
No permission checks are performed on bundle lifecycle operations, service registration and lookup, resource and class loading, weaving, or resolution.
-
The
org.apache.felix.framework.securitybundle is no longer built or released. It existed only to provide thePermissionAdminandConditionalPermissionAdminservices to the framework. The last release is 2.8.3 and it can only be used with the 7.x framework. See Apache Felix Framework Security.
The OSGi permission API is still exported and unchanged: AdminPermission, ServicePermission, PackagePermission, BundlePermission, CapabilityPermission, AdaptPermission, Bundle.hasPermission, ProtectionDomain and org.apache.felix.framework.ext.SecurityProvider all remain.
Bundles that reference those types continue to compile and resolve; the types simply no longer gate anything.
Bundles that merely declare permissions, for example by shipping OSGI-INF/permissions.perm, need no change.
Only code that relies on a permission being denied is affected.
Minimum Java version raised to 11
The framework inspects the caller’s class context in a few places to work out which framework instance or bundle a call belongs to.
That used to be done with a SecurityManager subclass, purely to reach the protected getClassContext() method.
It now uses java.lang.StackWalker, which is the supported replacement and is available from Java 9, so Java 8 is no longer possible.
The floor is 11 rather than 9 because 9 and 10 are non-LTS and long past end of life.
The framework bundle therefore declares Require-Capability: osgi.ee … JavaSE 11 and will not resolve on a Java 8 VM.
Other changes
-
sun.misc.Unsafeis still used in one place, to obtain a trustedMethodHandles.Lookupfor taking over the JVM-widejava.net.URLstream handler factory. It is guarded and falls back toAccessibleObject.setAccessible, so it degrades to a warning on recent JDKs. -
FilterImpl.WrapperCapability:Filter.matches(Map)no longer throwsUnsupportedOperationExceptionfor a non-empty map.
Related releases
The same release also removes Security Manager code paths from the other bundles that used them. None of them changes exported API; the minor version bumps reflect the behavioural change.
| Bundle | Version | Change |
|---|---|---|
Framework |
8.0.0 |
Security layer removed, Java 11 baseline. |
Main |
8.0.0 |
Launches framework 8.0.0 and inherits its requirements, including Java 11. |
Configuration Admin |
1.10.0 |
|
SCR (Declarative Services) |
2.3.0 |
Security Manager based permission checks and |
Web Console |
5.1.0 |
Security Manager based permission checks and |
Gogo Runtime |
1.2.0 |
|
Upgrading
-
Check the Java version you run on. Framework 8 needs Java 11 or later. If you must stay on Java 8, stay on the 7.x line.
-
If you launch with
org.osgi.framework.security,java.security.policyor-Djava.security.manager, remove those settings. Framework 8 fails at startup iforg.osgi.framework.securityis set. -
Remove the
org.apache.felix.framework.securitybundle from your installation, and any bundles that depend on itsPermissionAdminorConditionalPermissionAdminservices. -
If you embed the framework or build it from source, update to
org.apache.felix.framework8.0.0 ororg.apache.felix.main8.0.0. -
Upgrade the other bundles to the versions listed above. In particular, Configuration Admin 1.10.0 is needed on Java 20 and later, where the previous termination of its update thread fails.
-
Review any code that relies on a permission being denied: it will now be allowed.
The security layer can’t be restored on Java 24 and later, because the JDK no longer provides a Security Manager to enforce it.
Release notes
The full change history is in the framework’s changelog, and the 7.x/8.x split is also documented in the framework README.