WEB-START: RuntimeException: Cannot add UserAgentStylesheet as the method is not accessible

Issue #801 wontfix
Fouad Almalki
created an issue

The following snippets throw an exception at runtime (only on web-start environment):

new FontAwesome(ClassLoader.getSystemResource(FONT_AWESOME_FILE).toExternalForm());

Caused by: java.lang.RuntimeException: Cannot add UserAgentStylesheet as the method is not accessible at impl.org.controlsfx.ReflectionUtils.addUserAgentStylesheet(ReflectionUtils.java:230) at org.controlsfx.glyphfont.GlyphFont.<clinit>(GlyphFont.java:57)

Comments (5)

  1. Roger Terrell

    I get this same error in an app that is using controlsfx as a module:

    module MyModule { requires controlsfx; }

    Caused by: java.lang.RuntimeException: Cannot add UserAgentStylesheet as the method is not accessible at controlsfx@9.0.0/impl.org.controlsfx.ReflectionUtils.addUserAgentStylesheet(ReflectionUtils.java:230) at controlsfx@9.0.0/org.controlsfx.glyphfont.GlyphFont.<clinit>(GlyphFont.java:57) ... 21 more

  2. Roger Terrell

    I found that I can resolve my issue by adding these options to the JVM command line:

    --add-exports=javafx.base/com.sun.javafx.runtime=controlsfx
    --add-exports=javafx.graphics/com.sun.javafx.css=controlsfx
    
  3. Log in to comment