how do you make getResourceAsStream work while debugging Java in Eclipse?

后端 未结 6 1160
清酒与你
清酒与你 2020-12-03 06:05

This is mind-boggling... I can make getResource() and getResourceAsStream() work properly when I run Java on my packaged JAR file that includes a text file. (for reference s

6条回答
  •  有刺的猬
    2020-12-03 06:51

    I had the same problem in with IntelliJ, the solution for that was, In project settings, add the folder with the resource files, in my case sound files, as source. Add ?*.wav (or your pref filetype) in Settings->Compiler Resource patterns.

提交回复
热议问题