最近一个项目中需要从properties中读取信息,结果报Can't find bundle for base name configd, locale zh_CN,百度许久不得解google一下解决问题参考地址点击打开链接
解决办法:
1.将main文件夹添加到资源文件(New > Folder > Java Resources Folder)
2.将配置文件置于resources文件夹下
3.读取代码:
ResourceBundle motan_config = ResourceBundle.getBundle("config");
System.out.print(motan_config.getString("url"));