I am trying to follow the second tutorial https://github.com/AlmasB/FXGL/wiki/Adding-Images-and-Sounds-%28FXGL-11%29 and it appears that i get an error when i run the application. I use gradle run or run it in eclipse, without the sound everything works fine.
My project structure looks like this:
I use openJDK 11.0.3 and linux mint 19.1 64-bit.
It is just basically the same program as in the tutorial, i get the following exception:
Message: javafx/scene/media/AudioClip Type: NoClassDefFoundError
Method: DesktopAudioService.loadAudioImpl() Line:
DesktopAudioService.kt:28
My build.gradle is pretty straight forward i guess; the gradle init and the dependencies:
plugins {
id 'application'
id 'java-library'
id 'org.openjfx.javafxplugin' version '0.0.7'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
api 'org.apache.commons:commons-math3:3.6.1'
implementation 'com.google.guava:guava:27.0.1-jre'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
compile 'com.github.almasb:fxgl:11.1-beta'
}
javafx {
version = "12"
modules = [ 'javafx.controls' ]
}
mainClassName = 'game.idea.BasicGameApp'
I expect the sound to be played when clicking 'f' on my keyboard without crashing the program. I also hope for some background explanation what causes the error.