Summary
Remove support for running JavaFX applications with a Security Manager.
Problem
The Java Security Manager was deprecated for removal in JDK 17 by JEP 411. It will be permanently disabled soon, possibly in JDK 24, as proposed by candidate JEP 486. Once this is done, System::getSecurityManager
will unconditionally return null, System::setSecurityManager
will unconditionally throw UnsupportedOperationException
, and running "java -Dsecurity.manager"
will cause the VM to exit with a fatal error.
Solution
Remove support for running with a security manager as follows:
- Throw
UnsupportedOperationException
when the JavaFX runtime is initialized if a Security Manager is enabled (which can happen if JavaFX is run on an older JDK that still supports the Security Manager) - Update the API specification of various classes to remove mention of security manager, including any mention of throwing a
SecurityException
- Update the specification of the
FXPermission
class to remove the table of supported permissions, replacing it with a statement that it cannot be used for controlling access to resources
Specification
Throw the following exception when the JavaFX runtime is initialized if a Security Manager is enabled:
UnsupportedOperationException: JavaFX does not support running with the Security Manager
Update the API specification of the following classes to remove mention of security manager:
javafx.util.FXPermission
javafx.application.ConditionalFeature
javafx.print.JobSettings
javafx.print.Printer
javafx.print.PrinterJob
javafx.scene.input.Clipboard
javafx.scene.robot.Robot
javafx.scene.text.Font
javafx.stage.Stage
See the attached files diff-8337280.log
(raw diffs of the javadoc comments) and apidiff-8337280.zip
(output of apidiff) for the complete specification.
- csr of
-
JDK-8341090 Remove support for security manager from JavaFX
-
- Resolved
-