How to add a Java Properties file to my Java Project in Eclipse

前端 未结 8 895
[愿得一人]
[愿得一人] 2020-12-15 20:22

I was using Unix before to compile and edit my Java. In that I have used property files right inside my current working directory where the class file exists. Now i have swi

8条回答
  •  一整个雨季
    2020-12-15 20:36

    It should work ok as it is in Unix, if you have properties file in current working directory. Another option would be adding your properties file to the classpath and getting the inputstream using this.getClass().getClassLoader().getResourceAsStream("xxxxx.properties"); More here

提交回复
热议问题