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

SecurityException when running local build with security manager enabled

XMLWordPrintable

      To reproduce, run any JavaFX application on your local build with the security manager enabled. For example:

      $ java @build/run.args -Djava.security.manager -cp apps/toys/Hello/dist/Hello.jar hello.HelloRectangle

      Exception in thread "main" java.lang.ExceptionInInitializerError
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:538)
      at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:899)
      Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "javafx.verbose" "read")
      at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:471)
      at java.base/java.security.AccessController.checkPermission(AccessController.java:894)
      at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:548)
      at java.base/java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1292)
      at java.base/java.lang.System.getProperty(System.java:761)
      at java.base/java.lang.Boolean.getBoolean(Boolean.java:265)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$static$0(LauncherImpl.java:127)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.<clinit>(LauncherImpl.java:126)
      ... 5 more


      Note that the following works fine:

      $ java -Djava.security.manager -cp apps/toys/Hello/dist/Hello.jar hello.HelloRectangle

            ddhill David Hill (Inactive)
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: