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

jstatd fails to start because SecurityManager is disabled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 18
    • Component/s: core-svc
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b29

      Backports

        Description

        In JDK 18, attempting to run jstatd results in the following:

        $ jstatd
        Exception in thread "main" java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
        at java.base/java.lang.System.setSecurityManager(System.java:416)
        at jdk.jstatd/sun.tools.jstatd.Jstatd.main(Jstatd.java:136)

        The workaround is to allow setting the security manager property on the command line to allow programmatic setting of the security manager:

        $ jstatd -J-Djava.security.manager=allow

        Alternatively, the security manager could be enabled directly on the command line:

        $ jstatd -J-Djava.security.manager

        Either works, though they give different warning messages.

        The property should be set by the jstatd launcher instead of requiring the user to provide it.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                kevinw Kevin Walls
                Reporter:
                mullan Sean Mullan
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: