Classpath resource within jar

后端 未结 3 2031
别那么骄傲
别那么骄傲 2020-11-28 07:08

I have a project A, which contains some java files and a classpath resource R.txt. Within the project I use ClassLoader.getSystemResource(\"R.txt\"); to retrieve R.txt.

3条回答
  •  爱一瞬间的悲伤
    2020-11-28 07:31

    Does ClassLoader.getResource() work ? At the moment you're simply specifying that the system classloader is to be used.

提交回复
热议问题