Skip to content

Conversation

@holgerfriedrich
Copy link
Contributor

@holgerfriedrich holgerfriedrich commented Dec 30, 2025

This is a first step to prepare the 4.5 branch for running with Java 25.
Starting Karaf in Java 25 does not yet work, as a few functions related to the SecurityManager have been deprecated long time ago and cannot be activated any longer via command line switches.
As a new API has been added in Java 18, I for new lift the minimum required version to Java 21 (LTS).

Maybe this is not the way to go - as there has been some discussions if we could introduce an abstraction layer to allow Java 17 as well.

  • Lift minimum JDK version to 21
  • Remove occurrences of SecurityManager, as getSecurityManager returns
    null since JDK 18
  • Disable JavaSecurityTest, Rework JavaSecurityTest #2082
  • Enable verbose deprecation warnings
  • Replace getSubject and doAs calls
    ** getSubject can no longer be activated via JRE command line as
    SecurityManager has been removed in JDK 25.
    A replacement is available since Java 21.
    ** doAs was deprecated and is replaced by callAll.

For Java 25, another set of modifications is still needed and will be submitted as another PR.
Locally, I got Karaf compiling, passing the tests, and starting with Java 25. 🥳

* Lift minimum JDK version to 21
* Remove occurrences of SecurityManager, as getSecurityManager returns
  null since JDK 18
* Disable JavaSecurityTest, apache#2082
* Enable verbose deprecation warnings

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
getSubject can no longer be activated via JRE command line as
SecurityManager has been removed in JDK 25.
A replacement is available since Java 21.

doAs was deprecated and is replaced by callAll.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant