【发布时间】:2013-05-22 19:17:06
【问题描述】:
在这段代码中
in = new FileInputStream(getClass().getResource("/sonidos/inicio.wav").toString());
Eclipse 说:
java.io.FileNotFoundException: file:\C:\Users\OcioZ\Dropbox\Iker-Diego\JavaMusicianClient\bin\sonidos\inicio.wav (The file name, dir. name or vol. label name are not correct)
但声音文件存在。我正在将 "getClass().getResource("...").toString()" 写入识别的 jar 文件。
如果我只写相对路径:
in = new FileInputStream("/sonidos/inicio.wav");
声音在 Eclipse 中播放正确,但在 jar 文件中却没有声音。
有什么想法吗??
谢谢。
【问题讨论】:
标签: java eclipse audio jar path