Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Netbeans。我使用 BasicPlayer 3.0 libs 来播放歌曲,当使用 Netbeans 运行项目时播放正常,但是当运行我的 .jar 项目时,一旦有我的 .jar 文件(带有我的 lib 文件夹和 basicplayer3.0 jars),mp3 歌曲永远不会戏剧。
有什么帮助吗?
谢谢!
您的应用程序很可能没有从 jar 中找到 mp3 文件/资源。如果您的 mp3 文件保存在jar 文件中,那么您不能将其作为文件访问,而是作为资源访问,并且资源的路径与文件的路径不同。对于资源,路径将相对于您的类文件。
如需更多帮助,请向我们展示您获得的代码并尝试使用您的 mp3 文件。