sound will play in eclipse but not in exported jar file

前端 未结 2 405
没有蜡笔的小新
没有蜡笔的小新 2021-01-15 05:14

Sound does not play when I run the JAR, but it does when I run it in eclipse.

Here is where I load the clips: (the files are loaded from the directory of the jar, No

2条回答
  •  甜味超标
    2021-01-15 05:57

    The reason your sound is not playing because it is most likely not being compiled into your runnable jar and thus cannot be found. The best way to have it compile into a runnable jar is to create a source folder in eclipse, and then add your sound file in there. It will then be compiled into your jar

提交回复
热议问题