I am trying to build my project to a jar file. When I first opened the jar file I noticed nothing happened. I then launched the jar file from cmd. Then I saw it throws an error because it cannot find a txt file. This is the error:
Executing the program in IntelliJ works fine so I am assuming the txt file is not included in the artifact. This is how I use the txt file in the code:
This is what my file structure looks like:
This is what my artifact settings look like:
I tried putting the txt file in the src folder and manually including it in the artifact settings, I tried putting the txt file in the resources folder (It is marked as Resources Root) and I tried using the resources folder and also manually adding the resources folder to the artifact settings (this is the last thing I tried and is visible in the picture of my artifact settings).
I am really confused why the txt file doesn't seem to be in the jar file. Any help would be really appreciated.