Home >Java >javaTutorial >Why am I Getting a Module Error When Running My JavaFX Media Application?
Module error when running JavaFx media application
Question:
When I try to run my JavaFX application, I get the following error:
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
I'm not sure what is causing this error. My code is as follows:
import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.media.AudioClip; import javafx.stage.Stage; public class Main extends Application { @Override public void start(Stage primaryStage) { AudioClip audioClip = new AudioClip(getClass().getResource("/audio/sound.mp3").toString()); audioClip.play();
The above is the detailed content of Why am I Getting a Module Error When Running My JavaFX Media Application?. For more information, please follow other related articles on the PHP Chinese website!