mzsoft Member Nov 1, 2023 #1 I use this code to run wav file. B4X: Copy Dim mps As MediaPlayer mps.Initialize("",File.GetUri(recoder.InitialFilePath,"11012023102323.wav")) mps.Play file is ok and File.Exists return true. but this error happend. i used jdk14 B4X: Copy MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player! at javafx.media/javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146) at javafx.media/javafx.scene.media.MediaPlayer.init(MediaPlayer.java:518) at javafx.media/javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:421) at anywheresoftware.b4j.objects.MediaPlayerWrapper.Initialize(MediaPlayerWrapper.java:46) at b4j.example.main._appstart(main.java:539) 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:564) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell. java:237) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167) 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:564) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111) at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100) at anywheresoftware.b4a.BA.raiseEvent(BA.java:98) at b4j.example.main.start(main.java:42) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Acces sController.java:391) 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:832) Caused by: com.sun.media.jfxmedia.MediaException: Could not create player! at javafx.media/com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:295) at javafx.media/com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:118) at javafx.media/javafx.scene.media.MediaPlayer.init(MediaPlayer.java:474) ... 27 more
I use this code to run wav file. B4X: Copy Dim mps As MediaPlayer mps.Initialize("",File.GetUri(recoder.InitialFilePath,"11012023102323.wav")) mps.Play file is ok and File.Exists return true. but this error happend. i used jdk14 B4X: Copy MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player! at javafx.media/javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146) at javafx.media/javafx.scene.media.MediaPlayer.init(MediaPlayer.java:518) at javafx.media/javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:421) at anywheresoftware.b4j.objects.MediaPlayerWrapper.Initialize(MediaPlayerWrapper.java:46) at b4j.example.main._appstart(main.java:539) 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:564) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell. java:237) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167) 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:564) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111) at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100) at anywheresoftware.b4a.BA.raiseEvent(BA.java:98) at b4j.example.main.start(main.java:42) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Acces sController.java:391) 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:832) Caused by: com.sun.media.jfxmedia.MediaException: Could not create player! at javafx.media/com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:295) at javafx.media/com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:118) at javafx.media/javafx.scene.media.MediaPlayer.init(MediaPlayer.java:474) ... 27 more
Erel B4X founder Staff member Licensed User Longtime User Nov 2, 2023 #2 You can try it with a newer version of OpenJDK + JavaFX: https://www.b4x.com/android/forum/threads/update-openjdk.140167/post-887747 Maybe it will solve it. Upvote 0
You can try it with a newer version of OpenJDK + JavaFX: https://www.b4x.com/android/forum/threads/update-openjdk.140167/post-887747 Maybe it will solve it.
mzsoft Member Nov 2, 2023 #3 Erel said: You can try it with a newer version of OpenJDK + JavaFX: https://www.b4x.com/android/forum/threads/update-openjdk.140167/post-887747 Maybe it will solve it. Click to expand... i download - JavaFX SDK + jmods: https://gluonhq.com/products/javafx/ but cant find OpenJDK 17.0.9 for linux to download. Upvote 0
Erel said: You can try it with a newer version of OpenJDK + JavaFX: https://www.b4x.com/android/forum/threads/update-openjdk.140167/post-887747 Maybe it will solve it. Click to expand... i download - JavaFX SDK + jmods: https://gluonhq.com/products/javafx/ but cant find OpenJDK 17.0.9 for linux to download.
Erel B4X founder Staff member Licensed User Longtime User Nov 3, 2023 #4 Download the more recent OpenJDK you find. It doesn't need to match the JavaFX version. Upvote 0