我正在尝试读取Mp4文件作为学习JavaFX的入门者,但无法使路径正确:
public class Main extends Application {
@Override
public void start(Stage primaryStage){
Player player = new Player("file:/home/dave/Player/src/resources/small.mp4");
,错误是:
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:875)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$147(LauncherImpl.java:157)
at com.sun.javafx.application.LauncherImpl$$Lambda$1/142257191.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
我使用Linux(Ubuntu)与IntelliJ和JDK 8.我确信这很简单。