【Java123】

问题:IDEA编译器运行总报找不到资源文件的错误。

调查:

1. Myclass.class.getResourceAsStream(/myconfigfile.xml);

https://www.cnblogs.com/macwhirr/p/8116583.html

路径是ClassPath路径,没有问题。

2. 资源文件路径也设置为Source Folders 

https://www.cnblogs.com/alsf/p/9311527.html

因此定位不是工程设置的问题。

解决方案:

参考:https://www.oschina.net/question/944625_2215408?sort=time & https://www.bitdoom.com/2019/08/08/p150/

点击菜单 “build” -> “rebuild project”。

原文地址:https://www.cnblogs.com/cathygx/p/13208126.html