I tried to make one of my projects Modular, but if I do, I can't access my Resource files anymore.
How can I debug or declare which "Resources" my project should Use, within my "module-info.java"
Or is there a "moduleLoader" for the resources ?
Here is what I tried: Accessing resource files from external modules
Also My Code that prints true if it finds my resource. This is true, as long as my project is not modular. As soon as I create a module-info.java this is false.
public class Launcher {
public static void main(String[] args) {
System.out.println( Launcher.class.getClassLoader().getResourceAsStream("test.txt")!=null);
}
}
my Module Info:
module myModule{
opens com.project.main;
}
As soon as I remove my module-info.java, I can find the resource. Any explanation for this behavior?
Also my project Structure:
src
'--main
|'--java
| | '--com.project.main
| | '--Launcher.java
| '--module-info.java
'--resources
'-test.txt