Java migration: Add -Djava.security.manager=allow
if System.setSecurityManager
is used
#3523
Labels
recipe
Requested Recipe
Problem statement
With the deprecation of the security manager usages of
System.setSecurityManager
are not allowed without the-Djava.security.manager=allow
propertyIn Java 17 it is only a warning but in Java 20(or possibly earlier), it leads to the following error :
Example configuration (tests)
Any additional context
I believe that it is rare for users to call
System.setSecurityManager
directly. The one example I've seen so far is for projects testing System exit calls using libraries like systemlambdahttps://bugs.openjdk.org/browse/JDK-8199704
https://bugs.openjdk.org/browse/JDK-8267184
https://openjdk.org/jeps/411
stefanbirkner/system-lambda#27
The text was updated successfully, but these errors were encountered: