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

后端 未结 6 1180
清酒与你
清酒与你 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:58

    If you put your text file along with your source files, Eclipse will copy it to wherever it's placing its compiled .class files, and so you'll see your text file when you run your app from Eclipse (and you will be able to edit the file from within Eclipse as well).

提交回复
热议问题