I am developing an Android application that I have almost finished on Ubuntu and that is gaining the final touch on Arch Linux.
I have reinstalled Java and Eclipse, and the project is running without a problem, except that the media files cannot be executed, even if the classes all the same and the media files in the same location.
The code is exactly the same, only the platform has changed. I have tried with both open-jdk-8 and open-jdk-11.
This is the code from a testing project:
Form hi = new Form("Hi World", BoxLayout.y());
Button buttonSound = new Button("Play");
buttonSound.addActionListener(l -> {
InputStream inputStream = Display.getInstance().getResourceAsStream(getClass(), "/children-hooray.wav");
try {
Media media = MediaManager.createMedia(inputStream, "audio/wav");
media.play();
} catch (IOException e) {
e.printStackTrace();
}
});
hi.add(buttonSound);
hi.show();
Upon loading the console output is:
Adding CEF to classpath
Found theme.css file. Watching for changes...
CSS> Retina Scale: 1.0
CSS> Using stateful mode. Use -help flag to see options for new stateless mode.
CSS> Looks like this CSS file needs CEF on classpath... adding it now, and retrying...
CSS> Adding CEF to classpath
Retina Scale: 1.0
CSS> Retina Scale: 1.0
CSS> Using stateful mode. Use -help flag to see options for new stateless mode.
CSS> Updating merge file /home/rainer/eclipse-workspace/A1_Test_En/css/theme.css.merged
CSS> Starting watch thread to watch [/home/rainer/eclipse-workspace/A1_Test_En/css/theme.css]
CSS> Compiling /home/rainer/eclipse-workspace/A1_Test_En/css/theme.css.merged to /home/rainer/eclipse-workspace/A1_Test_En/src/theme.res
CSS> File has not changed since last compile.
CSS> CSS file successfully compiled. /home/rainer/eclipse-workspace/A1_Test_En/src/theme.res
and the Stack Trace is this :
Adding CEF to classpath
Retina Scale: 1.0
java.io.IOException
at com.codename1.impl.javase.JavaSEPort.createMedia(JavaSEPort.java:8506)
at com.codename1.ui.Display.createMedia(Display.java:3597)
at com.codename1.media.MediaManager.createMedia(MediaManager.java:308)
at com.codename1.media.MediaManager.createMedia(MediaManager.java:226)
at com.mycompany.myapp.Main.lambda$1(Main.java:65)
at com.codename1.ui.util.EventDispatcher.fireActionEvent(EventDispatcher.java:349)
at com.codename1.ui.Button.fireActionEvent(Button.java:687)
at com.codename1.ui.Button.released(Button.java:728)
at com.codename1.ui.Button.pointerReleased(Button.java:835)
at com.codename1.ui.LeadUtil.pointerReleased(LeadUtil.java:153)
at com.codename1.ui.Form.pointerReleased(Form.java:3817)
at com.codename1.ui.Component.pointerReleased(Component.java:4710)
at com.codename1.ui.Display.handleEvent(Display.java:2359)
at com.codename1.ui.Display.edtLoopImpl(Display.java:1244)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1162)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
