Module error when running JavaFx media application









up vote
0
down vote

favorite












When I run my JavaFX 11 application with the following command:



/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-p ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11.jar:
~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11-linux.jar:
~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11.jar:
~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11-linux.jar:
~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11.jar:
~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11-linux.jar:
~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11.jar:
~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11-linux.jar:
~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11.jar:
~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11-linux.jar
--add-modules javafx.controls,javafx.graphics
-classpath ~/development/intellij/OpenPatrician/OpenPatricianStandalone/target/classes:
~/.OpenPatrician/plugins/maps/MinimalMap-Plugin.jar:
~/development/intellij/OpenPatrician/OpenPatricianDisplay/target/classes:
~/.m2/repository/ch/sahits/sahitsUtil/1.2.4/sahitsUtil-1.2.4.jar:
~/.m2/repository/junit/junit/4.12/junit-4.12.jar:
~/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:
~/.m2/repository/org/springframework/boot/spring-boot-starter-log4j2/2.1.0.RELEASE/spring-boot-starter-log4j2-2.1.0.RELEASE.jar:
~/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.11.1/log4j-slf4j-impl-2.11.1.jar:
~/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:
~/.m2/repository/org/apache/logging/log4j/log4j-api/2.11.1/log4j-api-2.11.1.jar:
~/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.1/log4j-core-2.11.1.jar:
~/.m2/repository/org/apache/logging/log4j/log4j-jul/2.11.1/log4j-jul-2.11.1.jar:
~/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar:
~/.m2/repository/commons-cli/commons-cli/1.4/commons-cli-1.4.jar:
~/development/intellij/OpenPatrician/OpenPatricianImage/target/classes:
~/development/intellij/OpenPatrician/OpenPatricianModel/target/classes:
~/development/intellij/OpenPatrician/GameEvent/target/classes:
~/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.1/jaxb-runtime-2.3.1.jar:
~/.m2/repository/org/glassfish/jaxb/txw2/2.3.1/txw2-2.3.1.jar:
~/.m2/repository/com/sun/istack/istack-commons-runtime/3.0.7/istack-commons-runtime-3.0.7.jar:
~/.m2/repository/org/jvnet/staxex/stax-ex/1.8/stax-ex-1.8.jar:
~/.m2/repository/com/sun/xml/fastinfoset/FastInfoset/1.2.15/FastInfoset-1.2.15.jar:
~/.m2/repository/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar:
~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11.jar:
~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11-linux.jar:
~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11.jar:
~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11-linux.jar:
~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11.jar:
~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11-linux.jar:
~/development/intellij/OpenPatrician/OpenPatricianSound/target/classes:
~/development/intellij/OpenPatrician/OpenPatricianUtilities/target/classes:
~/.m2/repository/org/springframework/spring-beans/5.1.2.RELEASE/spring-beans-5.1.2.RELEASE.jar:
~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11.jar:
~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11-linux.jar:
~/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar:
~/.m2/repository/com/thoughtworks/xstream/xstream/1.4.10/xstream-1.4.10.jar:
~/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar:
~/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar:
~/.m2/repository/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar:
~/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:
~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11.jar:
~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11-linux.jar:
~/.m2/repository/org/springframework/spring-context/5.1.2.RELEASE/spring-context-5.1.2.RELEASE.jar:
~/.m2/repository/org/springframework/spring-aop/5.1.2.RELEASE/spring-aop-5.1.2.RELEASE.jar:
~/.m2/repository/org/springframework/spring-expression/5.1.2.RELEASE/spring-expression-5.1.2.RELEASE.jar:
~/.m2/repository/org/springframework/spring-oxm/5.1.2.RELEASE/spring-oxm-5.1.2.RELEASE.jar:
~/.m2/repository/com/google/guava/guava/24.1-jre/guava-24.1-jre.jar:
~/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:
~/.m2/repository/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0.jar:
~/.m2/repository/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar:
~/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:
~/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:
~/development/intellij/OpenPatrician/OpenPatricianJavaFX/target/classes:
~/development/intellij/OpenPatrician/OpenPatricianGameEvent/target/classes:
~/development/intellij/OpenPatrician/OpenPatricianClientServerInterface/target/classes:
~/.m2/repository/org/springframework/boot/spring-boot-starter-aop/2.1.0.RELEASE/spring-boot-starter-aop-2.1.0.RELEASE.jar:
~/.m2/repository/org/springframework/boot/spring-boot-starter/2.1.0.RELEASE/spring-boot-starter-2.1.0.RELEASE.jar:
~/.m2/repository/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar:
~/.m2/repository/org/aspectj/aspectjweaver/1.9.2/aspectjweaver-1.9.2.jar:
~/development/intellij/OpenPatrician/OpenPatricianServer/target/classes:
~/development/intellij/OpenPatrician/OpenPatricianEngine/target/classes:
~/.m2/repository/com/carrotsearch/hppc/0.7.2/hppc-0.7.2.jar:
~/.m2/repository/org/springframework/spring-core/5.1.2.RELEASE/spring-core-5.1.2.RELEASE.jar:
~/.m2/repository/org/springframework/spring-jcl/5.1.2.RELEASE/spring-jcl-5.1.2.RELEASE.jar:
~/.m2/repository/org/reflections/reflections/0.9.11/reflections-0.9.11.jar:
~/.m2/repository/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA.jar:
~/development/intellij/OpenPatrician/OpenPatricianData/target/classes:
~/.m2/repository/org/projectlombok/lombok/1.18.2/lombok-1.18.2.jar:
~/.m2/repository/org/springframework/boot/spring-boot-devtools/2.1.0.RELEASE/spring-boot-devtools-2.1.0.RELEASE.jar:
~/.m2/repository/org/springframework/boot/spring-boot/2.1.0.RELEASE/spring-boot-2.1.0.RELEASE.jar:
~/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.1.0.RELEASE/spring-boot-autoconfigure-2.1.0.RELEASE.jar
ch.sahits.game.openpatrician.standalone.OpenPatricianApplication


I run into this error:



Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessError: class com.sun.media.jfxmediaimpl.NativeMediaManager (in unnamed module @0x4d7be377) cannot access class com.sun.glass.utils.NativeLibLoader (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.utils to unnamed module @0x4d7be377
at com.sun.media.jfxmediaimpl.NativeMediaManager.lambda$new$0(NativeMediaManager.java:136)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at com.sun.media.jfxmediaimpl.NativeMediaManager.<init>(NativeMediaManager.java:107)
at com.sun.media.jfxmediaimpl.NativeMediaManager$NativeMediaManagerInitializer.<clinit>(NativeMediaManager.java:78)
at com.sun.media.jfxmediaimpl.NativeMediaManager.getDefaultInstance(NativeMediaManager.java:90)
at com.sun.media.jfxmedia.MediaManager.canPlayProtocol(MediaManager.java:78)
at com.sun.media.jfxmedia.locator.Locator.<init>(Locator.java:239)
at com.sun.media.jfxmediaimpl.NativeMediaAudioClip.<init>(NativeMediaAudioClip.java:53)
at com.sun.media.jfxmediaimpl.NativeMediaAudioClip.load(NativeMediaAudioClip.java:63)
at com.sun.media.jfxmediaimpl.AudioClipProvider.load(AudioClipProvider.java:66)
at com.sun.media.jfxmedia.AudioClip.load(AudioClip.java:135)
at javafx.scene.media.AudioClip.<init>(AudioClip.java:83)
at ch.sahits.game.openpatrician.sound.impl.LoopTrack.lambda$new$0(LoopTrack.java:26)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
at java.base/java.lang.Thread.run(Thread.java:834)


As I understand this exception there is something wrong with my module setup, but I am not clear what I need to change:



  • Add additional modules to --add-modules and which?

  • Add --add-opens to the command with which modules

  • Something completely different?









share|improve this question



























    up vote
    0
    down vote

    favorite












    When I run my JavaFX 11 application with the following command:



    /usr/lib/jvm/java-11-openjdk-amd64/bin/java 
    -p ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11.jar:
    ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11-linux.jar:
    ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11.jar:
    ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11-linux.jar:
    ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11.jar:
    ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11-linux.jar:
    ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11.jar:
    ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11-linux.jar:
    ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11.jar:
    ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11-linux.jar
    --add-modules javafx.controls,javafx.graphics
    -classpath ~/development/intellij/OpenPatrician/OpenPatricianStandalone/target/classes:
    ~/.OpenPatrician/plugins/maps/MinimalMap-Plugin.jar:
    ~/development/intellij/OpenPatrician/OpenPatricianDisplay/target/classes:
    ~/.m2/repository/ch/sahits/sahitsUtil/1.2.4/sahitsUtil-1.2.4.jar:
    ~/.m2/repository/junit/junit/4.12/junit-4.12.jar:
    ~/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:
    ~/.m2/repository/org/springframework/boot/spring-boot-starter-log4j2/2.1.0.RELEASE/spring-boot-starter-log4j2-2.1.0.RELEASE.jar:
    ~/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.11.1/log4j-slf4j-impl-2.11.1.jar:
    ~/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:
    ~/.m2/repository/org/apache/logging/log4j/log4j-api/2.11.1/log4j-api-2.11.1.jar:
    ~/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.1/log4j-core-2.11.1.jar:
    ~/.m2/repository/org/apache/logging/log4j/log4j-jul/2.11.1/log4j-jul-2.11.1.jar:
    ~/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar:
    ~/.m2/repository/commons-cli/commons-cli/1.4/commons-cli-1.4.jar:
    ~/development/intellij/OpenPatrician/OpenPatricianImage/target/classes:
    ~/development/intellij/OpenPatrician/OpenPatricianModel/target/classes:
    ~/development/intellij/OpenPatrician/GameEvent/target/classes:
    ~/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.1/jaxb-runtime-2.3.1.jar:
    ~/.m2/repository/org/glassfish/jaxb/txw2/2.3.1/txw2-2.3.1.jar:
    ~/.m2/repository/com/sun/istack/istack-commons-runtime/3.0.7/istack-commons-runtime-3.0.7.jar:
    ~/.m2/repository/org/jvnet/staxex/stax-ex/1.8/stax-ex-1.8.jar:
    ~/.m2/repository/com/sun/xml/fastinfoset/FastInfoset/1.2.15/FastInfoset-1.2.15.jar:
    ~/.m2/repository/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar:
    ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11.jar:
    ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11-linux.jar:
    ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11.jar:
    ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11-linux.jar:
    ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11.jar:
    ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11-linux.jar:
    ~/development/intellij/OpenPatrician/OpenPatricianSound/target/classes:
    ~/development/intellij/OpenPatrician/OpenPatricianUtilities/target/classes:
    ~/.m2/repository/org/springframework/spring-beans/5.1.2.RELEASE/spring-beans-5.1.2.RELEASE.jar:
    ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11.jar:
    ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11-linux.jar:
    ~/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar:
    ~/.m2/repository/com/thoughtworks/xstream/xstream/1.4.10/xstream-1.4.10.jar:
    ~/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar:
    ~/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar:
    ~/.m2/repository/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar:
    ~/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:
    ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11.jar:
    ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11-linux.jar:
    ~/.m2/repository/org/springframework/spring-context/5.1.2.RELEASE/spring-context-5.1.2.RELEASE.jar:
    ~/.m2/repository/org/springframework/spring-aop/5.1.2.RELEASE/spring-aop-5.1.2.RELEASE.jar:
    ~/.m2/repository/org/springframework/spring-expression/5.1.2.RELEASE/spring-expression-5.1.2.RELEASE.jar:
    ~/.m2/repository/org/springframework/spring-oxm/5.1.2.RELEASE/spring-oxm-5.1.2.RELEASE.jar:
    ~/.m2/repository/com/google/guava/guava/24.1-jre/guava-24.1-jre.jar:
    ~/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:
    ~/.m2/repository/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0.jar:
    ~/.m2/repository/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar:
    ~/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:
    ~/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:
    ~/development/intellij/OpenPatrician/OpenPatricianJavaFX/target/classes:
    ~/development/intellij/OpenPatrician/OpenPatricianGameEvent/target/classes:
    ~/development/intellij/OpenPatrician/OpenPatricianClientServerInterface/target/classes:
    ~/.m2/repository/org/springframework/boot/spring-boot-starter-aop/2.1.0.RELEASE/spring-boot-starter-aop-2.1.0.RELEASE.jar:
    ~/.m2/repository/org/springframework/boot/spring-boot-starter/2.1.0.RELEASE/spring-boot-starter-2.1.0.RELEASE.jar:
    ~/.m2/repository/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar:
    ~/.m2/repository/org/aspectj/aspectjweaver/1.9.2/aspectjweaver-1.9.2.jar:
    ~/development/intellij/OpenPatrician/OpenPatricianServer/target/classes:
    ~/development/intellij/OpenPatrician/OpenPatricianEngine/target/classes:
    ~/.m2/repository/com/carrotsearch/hppc/0.7.2/hppc-0.7.2.jar:
    ~/.m2/repository/org/springframework/spring-core/5.1.2.RELEASE/spring-core-5.1.2.RELEASE.jar:
    ~/.m2/repository/org/springframework/spring-jcl/5.1.2.RELEASE/spring-jcl-5.1.2.RELEASE.jar:
    ~/.m2/repository/org/reflections/reflections/0.9.11/reflections-0.9.11.jar:
    ~/.m2/repository/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA.jar:
    ~/development/intellij/OpenPatrician/OpenPatricianData/target/classes:
    ~/.m2/repository/org/projectlombok/lombok/1.18.2/lombok-1.18.2.jar:
    ~/.m2/repository/org/springframework/boot/spring-boot-devtools/2.1.0.RELEASE/spring-boot-devtools-2.1.0.RELEASE.jar:
    ~/.m2/repository/org/springframework/boot/spring-boot/2.1.0.RELEASE/spring-boot-2.1.0.RELEASE.jar:
    ~/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.1.0.RELEASE/spring-boot-autoconfigure-2.1.0.RELEASE.jar
    ch.sahits.game.openpatrician.standalone.OpenPatricianApplication


    I run into this error:



    Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessError: class com.sun.media.jfxmediaimpl.NativeMediaManager (in unnamed module @0x4d7be377) cannot access class com.sun.glass.utils.NativeLibLoader (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.utils to unnamed module @0x4d7be377
    at com.sun.media.jfxmediaimpl.NativeMediaManager.lambda$new$0(NativeMediaManager.java:136)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at com.sun.media.jfxmediaimpl.NativeMediaManager.<init>(NativeMediaManager.java:107)
    at com.sun.media.jfxmediaimpl.NativeMediaManager$NativeMediaManagerInitializer.<clinit>(NativeMediaManager.java:78)
    at com.sun.media.jfxmediaimpl.NativeMediaManager.getDefaultInstance(NativeMediaManager.java:90)
    at com.sun.media.jfxmedia.MediaManager.canPlayProtocol(MediaManager.java:78)
    at com.sun.media.jfxmedia.locator.Locator.<init>(Locator.java:239)
    at com.sun.media.jfxmediaimpl.NativeMediaAudioClip.<init>(NativeMediaAudioClip.java:53)
    at com.sun.media.jfxmediaimpl.NativeMediaAudioClip.load(NativeMediaAudioClip.java:63)
    at com.sun.media.jfxmediaimpl.AudioClipProvider.load(AudioClipProvider.java:66)
    at com.sun.media.jfxmedia.AudioClip.load(AudioClip.java:135)
    at javafx.scene.media.AudioClip.<init>(AudioClip.java:83)
    at ch.sahits.game.openpatrician.sound.impl.LoopTrack.lambda$new$0(LoopTrack.java:26)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
    at java.base/java.lang.Thread.run(Thread.java:834)


    As I understand this exception there is something wrong with my module setup, but I am not clear what I need to change:



    • Add additional modules to --add-modules and which?

    • Add --add-opens to the command with which modules

    • Something completely different?









    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      When I run my JavaFX 11 application with the following command:



      /usr/lib/jvm/java-11-openjdk-amd64/bin/java 
      -p ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11.jar:
      ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11.jar:
      ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11.jar:
      ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11.jar:
      ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11.jar:
      ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11-linux.jar
      --add-modules javafx.controls,javafx.graphics
      -classpath ~/development/intellij/OpenPatrician/OpenPatricianStandalone/target/classes:
      ~/.OpenPatrician/plugins/maps/MinimalMap-Plugin.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianDisplay/target/classes:
      ~/.m2/repository/ch/sahits/sahitsUtil/1.2.4/sahitsUtil-1.2.4.jar:
      ~/.m2/repository/junit/junit/4.12/junit-4.12.jar:
      ~/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:
      ~/.m2/repository/org/springframework/boot/spring-boot-starter-log4j2/2.1.0.RELEASE/spring-boot-starter-log4j2-2.1.0.RELEASE.jar:
      ~/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.11.1/log4j-slf4j-impl-2.11.1.jar:
      ~/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:
      ~/.m2/repository/org/apache/logging/log4j/log4j-api/2.11.1/log4j-api-2.11.1.jar:
      ~/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.1/log4j-core-2.11.1.jar:
      ~/.m2/repository/org/apache/logging/log4j/log4j-jul/2.11.1/log4j-jul-2.11.1.jar:
      ~/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar:
      ~/.m2/repository/commons-cli/commons-cli/1.4/commons-cli-1.4.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianImage/target/classes:
      ~/development/intellij/OpenPatrician/OpenPatricianModel/target/classes:
      ~/development/intellij/OpenPatrician/GameEvent/target/classes:
      ~/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.1/jaxb-runtime-2.3.1.jar:
      ~/.m2/repository/org/glassfish/jaxb/txw2/2.3.1/txw2-2.3.1.jar:
      ~/.m2/repository/com/sun/istack/istack-commons-runtime/3.0.7/istack-commons-runtime-3.0.7.jar:
      ~/.m2/repository/org/jvnet/staxex/stax-ex/1.8/stax-ex-1.8.jar:
      ~/.m2/repository/com/sun/xml/fastinfoset/FastInfoset/1.2.15/FastInfoset-1.2.15.jar:
      ~/.m2/repository/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar:
      ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11.jar:
      ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11.jar:
      ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11.jar:
      ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11-linux.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianSound/target/classes:
      ~/development/intellij/OpenPatrician/OpenPatricianUtilities/target/classes:
      ~/.m2/repository/org/springframework/spring-beans/5.1.2.RELEASE/spring-beans-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11.jar:
      ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11-linux.jar:
      ~/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar:
      ~/.m2/repository/com/thoughtworks/xstream/xstream/1.4.10/xstream-1.4.10.jar:
      ~/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar:
      ~/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar:
      ~/.m2/repository/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar:
      ~/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:
      ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11.jar:
      ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11-linux.jar:
      ~/.m2/repository/org/springframework/spring-context/5.1.2.RELEASE/spring-context-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/springframework/spring-aop/5.1.2.RELEASE/spring-aop-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/springframework/spring-expression/5.1.2.RELEASE/spring-expression-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/springframework/spring-oxm/5.1.2.RELEASE/spring-oxm-5.1.2.RELEASE.jar:
      ~/.m2/repository/com/google/guava/guava/24.1-jre/guava-24.1-jre.jar:
      ~/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:
      ~/.m2/repository/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0.jar:
      ~/.m2/repository/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar:
      ~/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:
      ~/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianJavaFX/target/classes:
      ~/development/intellij/OpenPatrician/OpenPatricianGameEvent/target/classes:
      ~/development/intellij/OpenPatrician/OpenPatricianClientServerInterface/target/classes:
      ~/.m2/repository/org/springframework/boot/spring-boot-starter-aop/2.1.0.RELEASE/spring-boot-starter-aop-2.1.0.RELEASE.jar:
      ~/.m2/repository/org/springframework/boot/spring-boot-starter/2.1.0.RELEASE/spring-boot-starter-2.1.0.RELEASE.jar:
      ~/.m2/repository/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar:
      ~/.m2/repository/org/aspectj/aspectjweaver/1.9.2/aspectjweaver-1.9.2.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianServer/target/classes:
      ~/development/intellij/OpenPatrician/OpenPatricianEngine/target/classes:
      ~/.m2/repository/com/carrotsearch/hppc/0.7.2/hppc-0.7.2.jar:
      ~/.m2/repository/org/springframework/spring-core/5.1.2.RELEASE/spring-core-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/springframework/spring-jcl/5.1.2.RELEASE/spring-jcl-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/reflections/reflections/0.9.11/reflections-0.9.11.jar:
      ~/.m2/repository/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianData/target/classes:
      ~/.m2/repository/org/projectlombok/lombok/1.18.2/lombok-1.18.2.jar:
      ~/.m2/repository/org/springframework/boot/spring-boot-devtools/2.1.0.RELEASE/spring-boot-devtools-2.1.0.RELEASE.jar:
      ~/.m2/repository/org/springframework/boot/spring-boot/2.1.0.RELEASE/spring-boot-2.1.0.RELEASE.jar:
      ~/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.1.0.RELEASE/spring-boot-autoconfigure-2.1.0.RELEASE.jar
      ch.sahits.game.openpatrician.standalone.OpenPatricianApplication


      I run into this error:



      Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessError: class com.sun.media.jfxmediaimpl.NativeMediaManager (in unnamed module @0x4d7be377) cannot access class com.sun.glass.utils.NativeLibLoader (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.utils to unnamed module @0x4d7be377
      at com.sun.media.jfxmediaimpl.NativeMediaManager.lambda$new$0(NativeMediaManager.java:136)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at com.sun.media.jfxmediaimpl.NativeMediaManager.<init>(NativeMediaManager.java:107)
      at com.sun.media.jfxmediaimpl.NativeMediaManager$NativeMediaManagerInitializer.<clinit>(NativeMediaManager.java:78)
      at com.sun.media.jfxmediaimpl.NativeMediaManager.getDefaultInstance(NativeMediaManager.java:90)
      at com.sun.media.jfxmedia.MediaManager.canPlayProtocol(MediaManager.java:78)
      at com.sun.media.jfxmedia.locator.Locator.<init>(Locator.java:239)
      at com.sun.media.jfxmediaimpl.NativeMediaAudioClip.<init>(NativeMediaAudioClip.java:53)
      at com.sun.media.jfxmediaimpl.NativeMediaAudioClip.load(NativeMediaAudioClip.java:63)
      at com.sun.media.jfxmediaimpl.AudioClipProvider.load(AudioClipProvider.java:66)
      at com.sun.media.jfxmedia.AudioClip.load(AudioClip.java:135)
      at javafx.scene.media.AudioClip.<init>(AudioClip.java:83)
      at ch.sahits.game.openpatrician.sound.impl.LoopTrack.lambda$new$0(LoopTrack.java:26)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
      at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
      at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
      at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
      at java.base/java.lang.Thread.run(Thread.java:834)


      As I understand this exception there is something wrong with my module setup, but I am not clear what I need to change:



      • Add additional modules to --add-modules and which?

      • Add --add-opens to the command with which modules

      • Something completely different?









      share|improve this question















      When I run my JavaFX 11 application with the following command:



      /usr/lib/jvm/java-11-openjdk-amd64/bin/java 
      -p ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11.jar:
      ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11.jar:
      ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11.jar:
      ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11.jar:
      ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11.jar:
      ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11-linux.jar
      --add-modules javafx.controls,javafx.graphics
      -classpath ~/development/intellij/OpenPatrician/OpenPatricianStandalone/target/classes:
      ~/.OpenPatrician/plugins/maps/MinimalMap-Plugin.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianDisplay/target/classes:
      ~/.m2/repository/ch/sahits/sahitsUtil/1.2.4/sahitsUtil-1.2.4.jar:
      ~/.m2/repository/junit/junit/4.12/junit-4.12.jar:
      ~/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:
      ~/.m2/repository/org/springframework/boot/spring-boot-starter-log4j2/2.1.0.RELEASE/spring-boot-starter-log4j2-2.1.0.RELEASE.jar:
      ~/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.11.1/log4j-slf4j-impl-2.11.1.jar:
      ~/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:
      ~/.m2/repository/org/apache/logging/log4j/log4j-api/2.11.1/log4j-api-2.11.1.jar:
      ~/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.1/log4j-core-2.11.1.jar:
      ~/.m2/repository/org/apache/logging/log4j/log4j-jul/2.11.1/log4j-jul-2.11.1.jar:
      ~/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar:
      ~/.m2/repository/commons-cli/commons-cli/1.4/commons-cli-1.4.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianImage/target/classes:
      ~/development/intellij/OpenPatrician/OpenPatricianModel/target/classes:
      ~/development/intellij/OpenPatrician/GameEvent/target/classes:
      ~/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.1/jaxb-runtime-2.3.1.jar:
      ~/.m2/repository/org/glassfish/jaxb/txw2/2.3.1/txw2-2.3.1.jar:
      ~/.m2/repository/com/sun/istack/istack-commons-runtime/3.0.7/istack-commons-runtime-3.0.7.jar:
      ~/.m2/repository/org/jvnet/staxex/stax-ex/1.8/stax-ex-1.8.jar:
      ~/.m2/repository/com/sun/xml/fastinfoset/FastInfoset/1.2.15/FastInfoset-1.2.15.jar:
      ~/.m2/repository/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar:
      ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11.jar:
      ~/.m2/repository/org/openjfx/javafx-swing/11/javafx-swing-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11.jar:
      ~/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11-linux.jar:
      ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11.jar:
      ~/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11-linux.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianSound/target/classes:
      ~/development/intellij/OpenPatrician/OpenPatricianUtilities/target/classes:
      ~/.m2/repository/org/springframework/spring-beans/5.1.2.RELEASE/spring-beans-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11.jar:
      ~/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11-linux.jar:
      ~/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar:
      ~/.m2/repository/com/thoughtworks/xstream/xstream/1.4.10/xstream-1.4.10.jar:
      ~/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar:
      ~/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar:
      ~/.m2/repository/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar:
      ~/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:
      ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11.jar:
      ~/.m2/repository/org/openjfx/javafx-media/11/javafx-media-11-linux.jar:
      ~/.m2/repository/org/springframework/spring-context/5.1.2.RELEASE/spring-context-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/springframework/spring-aop/5.1.2.RELEASE/spring-aop-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/springframework/spring-expression/5.1.2.RELEASE/spring-expression-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/springframework/spring-oxm/5.1.2.RELEASE/spring-oxm-5.1.2.RELEASE.jar:
      ~/.m2/repository/com/google/guava/guava/24.1-jre/guava-24.1-jre.jar:
      ~/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:
      ~/.m2/repository/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0.jar:
      ~/.m2/repository/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar:
      ~/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:
      ~/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianJavaFX/target/classes:
      ~/development/intellij/OpenPatrician/OpenPatricianGameEvent/target/classes:
      ~/development/intellij/OpenPatrician/OpenPatricianClientServerInterface/target/classes:
      ~/.m2/repository/org/springframework/boot/spring-boot-starter-aop/2.1.0.RELEASE/spring-boot-starter-aop-2.1.0.RELEASE.jar:
      ~/.m2/repository/org/springframework/boot/spring-boot-starter/2.1.0.RELEASE/spring-boot-starter-2.1.0.RELEASE.jar:
      ~/.m2/repository/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar:
      ~/.m2/repository/org/aspectj/aspectjweaver/1.9.2/aspectjweaver-1.9.2.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianServer/target/classes:
      ~/development/intellij/OpenPatrician/OpenPatricianEngine/target/classes:
      ~/.m2/repository/com/carrotsearch/hppc/0.7.2/hppc-0.7.2.jar:
      ~/.m2/repository/org/springframework/spring-core/5.1.2.RELEASE/spring-core-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/springframework/spring-jcl/5.1.2.RELEASE/spring-jcl-5.1.2.RELEASE.jar:
      ~/.m2/repository/org/reflections/reflections/0.9.11/reflections-0.9.11.jar:
      ~/.m2/repository/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA.jar:
      ~/development/intellij/OpenPatrician/OpenPatricianData/target/classes:
      ~/.m2/repository/org/projectlombok/lombok/1.18.2/lombok-1.18.2.jar:
      ~/.m2/repository/org/springframework/boot/spring-boot-devtools/2.1.0.RELEASE/spring-boot-devtools-2.1.0.RELEASE.jar:
      ~/.m2/repository/org/springframework/boot/spring-boot/2.1.0.RELEASE/spring-boot-2.1.0.RELEASE.jar:
      ~/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.1.0.RELEASE/spring-boot-autoconfigure-2.1.0.RELEASE.jar
      ch.sahits.game.openpatrician.standalone.OpenPatricianApplication


      I run into this error:



      Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessError: class com.sun.media.jfxmediaimpl.NativeMediaManager (in unnamed module @0x4d7be377) cannot access class com.sun.glass.utils.NativeLibLoader (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.utils to unnamed module @0x4d7be377
      at com.sun.media.jfxmediaimpl.NativeMediaManager.lambda$new$0(NativeMediaManager.java:136)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at com.sun.media.jfxmediaimpl.NativeMediaManager.<init>(NativeMediaManager.java:107)
      at com.sun.media.jfxmediaimpl.NativeMediaManager$NativeMediaManagerInitializer.<clinit>(NativeMediaManager.java:78)
      at com.sun.media.jfxmediaimpl.NativeMediaManager.getDefaultInstance(NativeMediaManager.java:90)
      at com.sun.media.jfxmedia.MediaManager.canPlayProtocol(MediaManager.java:78)
      at com.sun.media.jfxmedia.locator.Locator.<init>(Locator.java:239)
      at com.sun.media.jfxmediaimpl.NativeMediaAudioClip.<init>(NativeMediaAudioClip.java:53)
      at com.sun.media.jfxmediaimpl.NativeMediaAudioClip.load(NativeMediaAudioClip.java:63)
      at com.sun.media.jfxmediaimpl.AudioClipProvider.load(AudioClipProvider.java:66)
      at com.sun.media.jfxmedia.AudioClip.load(AudioClip.java:135)
      at javafx.scene.media.AudioClip.<init>(AudioClip.java:83)
      at ch.sahits.game.openpatrician.sound.impl.LoopTrack.lambda$new$0(LoopTrack.java:26)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
      at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
      at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
      at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
      at java.base/java.lang.Thread.run(Thread.java:834)


      As I understand this exception there is something wrong with my module setup, but I am not clear what I need to change:



      • Add additional modules to --add-modules and which?

      • Add --add-opens to the command with which modules

      • Something completely different?






      java javafx module






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 10 at 9:43

























      asked Nov 10 at 8:30









      hotzst

      4,13431640




      4,13431640






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          JavaFX 11 is split into seven modules. In your command line you have:



          --add-modules javafx.controls,javafx.graphics


          And the error you're getting is:



          java.lang.IllegalAccessError: class com.sun.media.jfxmediaimpl.NativeMediaManager (in unnamed module @0x4d7be377) cannot access class com.sun.glass.utils.NativeLibLoader (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.utils to unnamed module @0x4d7be377


          It's telling you that a class, within the com.sun.media.jfxmediaimpl package, is in the unnamed module and is trying to access internal members of the javafx.graphics module. The name of the package indicates that it belongs to the javafx.media module. The error indicates, however, that you're using the javafx.media module from the classpath. You need to include javafx.media in the --add-modules command to use it from the modulepath:



          --add-modules javafx.controls,javafx.graphics,javafx.media



          On a related note, you don't need to include javafx.graphics in the command as you are already adding javafx.controls. Both javafx.controls and javafx.media require the javafx.graphics and javafx.base modules.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237287%2fmodule-error-when-running-javafx-media-application%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            JavaFX 11 is split into seven modules. In your command line you have:



            --add-modules javafx.controls,javafx.graphics


            And the error you're getting is:



            java.lang.IllegalAccessError: class com.sun.media.jfxmediaimpl.NativeMediaManager (in unnamed module @0x4d7be377) cannot access class com.sun.glass.utils.NativeLibLoader (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.utils to unnamed module @0x4d7be377


            It's telling you that a class, within the com.sun.media.jfxmediaimpl package, is in the unnamed module and is trying to access internal members of the javafx.graphics module. The name of the package indicates that it belongs to the javafx.media module. The error indicates, however, that you're using the javafx.media module from the classpath. You need to include javafx.media in the --add-modules command to use it from the modulepath:



            --add-modules javafx.controls,javafx.graphics,javafx.media



            On a related note, you don't need to include javafx.graphics in the command as you are already adding javafx.controls. Both javafx.controls and javafx.media require the javafx.graphics and javafx.base modules.






            share|improve this answer


























              up vote
              1
              down vote



              accepted










              JavaFX 11 is split into seven modules. In your command line you have:



              --add-modules javafx.controls,javafx.graphics


              And the error you're getting is:



              java.lang.IllegalAccessError: class com.sun.media.jfxmediaimpl.NativeMediaManager (in unnamed module @0x4d7be377) cannot access class com.sun.glass.utils.NativeLibLoader (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.utils to unnamed module @0x4d7be377


              It's telling you that a class, within the com.sun.media.jfxmediaimpl package, is in the unnamed module and is trying to access internal members of the javafx.graphics module. The name of the package indicates that it belongs to the javafx.media module. The error indicates, however, that you're using the javafx.media module from the classpath. You need to include javafx.media in the --add-modules command to use it from the modulepath:



              --add-modules javafx.controls,javafx.graphics,javafx.media



              On a related note, you don't need to include javafx.graphics in the command as you are already adding javafx.controls. Both javafx.controls and javafx.media require the javafx.graphics and javafx.base modules.






              share|improve this answer
























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                JavaFX 11 is split into seven modules. In your command line you have:



                --add-modules javafx.controls,javafx.graphics


                And the error you're getting is:



                java.lang.IllegalAccessError: class com.sun.media.jfxmediaimpl.NativeMediaManager (in unnamed module @0x4d7be377) cannot access class com.sun.glass.utils.NativeLibLoader (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.utils to unnamed module @0x4d7be377


                It's telling you that a class, within the com.sun.media.jfxmediaimpl package, is in the unnamed module and is trying to access internal members of the javafx.graphics module. The name of the package indicates that it belongs to the javafx.media module. The error indicates, however, that you're using the javafx.media module from the classpath. You need to include javafx.media in the --add-modules command to use it from the modulepath:



                --add-modules javafx.controls,javafx.graphics,javafx.media



                On a related note, you don't need to include javafx.graphics in the command as you are already adding javafx.controls. Both javafx.controls and javafx.media require the javafx.graphics and javafx.base modules.






                share|improve this answer














                JavaFX 11 is split into seven modules. In your command line you have:



                --add-modules javafx.controls,javafx.graphics


                And the error you're getting is:



                java.lang.IllegalAccessError: class com.sun.media.jfxmediaimpl.NativeMediaManager (in unnamed module @0x4d7be377) cannot access class com.sun.glass.utils.NativeLibLoader (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.utils to unnamed module @0x4d7be377


                It's telling you that a class, within the com.sun.media.jfxmediaimpl package, is in the unnamed module and is trying to access internal members of the javafx.graphics module. The name of the package indicates that it belongs to the javafx.media module. The error indicates, however, that you're using the javafx.media module from the classpath. You need to include javafx.media in the --add-modules command to use it from the modulepath:



                --add-modules javafx.controls,javafx.graphics,javafx.media



                On a related note, you don't need to include javafx.graphics in the command as you are already adding javafx.controls. Both javafx.controls and javafx.media require the javafx.graphics and javafx.base modules.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 10 at 9:45

























                answered Nov 10 at 9:35









                Slaw

                5,7382829




                5,7382829



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237287%2fmodule-error-when-running-javafx-media-application%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Use pre created SQLite database for Android project in kotlin

                    Darth Vader #20

                    Ondo