Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8341858

Remove support for security manager from JavaFX

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P2 P2
    • jfx24
    • javafx
    • None
    • behavioral
    • low
    • Hide
      Applications that use JavaFX 24 with a JDK that still supports the Security Manager, such as JDK 23, will no longer be able to run a JavaFX application with the security manager enabled. They will need to run without enabling the security manager. We expect such use to be rare. Application developers who want to continue using the Security manager will need to run with an older version of JavaFX and an older version of the JDK.
      Show
      Applications that use JavaFX 24 with a JDK that still supports the Security Manager, such as JDK 23, will no longer be able to run a JavaFX application with the security manager enabled. They will need to run without enabling the security manager. We expect such use to be rare. Application developers who want to continue using the Security manager will need to run with an older version of JavaFX and an older version of the JDK.
    • Java API, System or security property
    • JDK

      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.

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Ambarish Rapte
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: