Eclipse getResourceAsStream returning null

后端 未结 6 1769
鱼传尺愫
鱼传尺愫 2020-12-10 04:15

I cannot get getResourceAsStream to find a file. I have put the file in the top level dir, target dir, etc, etc and have tried it with a \"/\" in front as well. Everytime

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-10 05:11

    Sometimes you need to tell eclipse explicitly what types of files to copy from the source folder to the distribution (classes) folder.

    i have Eclipse SDK, Version: 3.7.1, Build id: M20110909-1335, Indigo and in this i did the following changes.

    Project -> Properties -> Java Build Path -> Source (tab) -> Included (list item) -> Edit (button) to add */.txt to the existing */.java.

提交回复
热议问题