※ I have looked at the old questions and none fixed my problem.
I am having an issue of getResourceAsStream
returning null
. It works in Eclipse but not when I use the project as a jar file.
The jar file has a folder name config
and in the folder config, there is a config file
. I try to import the config file using the code below.
file = "/" + new File(configFolder, configFileName).getPath();
in = this.getClass().getResourceAsStream(file);
The jar worked before. But now that I changed my codes and put the code above in an abstract class. It isn't working. getResourceAsStream is returning null.
I tried MyAbstractClass.class.getResourceAsStream(file)
but still it isn't working.