I just finished a little game and now I want to export it, so that I can use it as a normal application, which I can start from my desktop. It is working, but when it tries to read the .txt files, where I want to save a few important things, it isn't working anymore. But in the IDE it is working. I tested it with Eclipse and IntelliJ, but I get the same result.
That's how I tried to save all of the things. the pictures are in folders in the res folder, which is in the src folder. this is working fine. I tried the same thing with the file in the saves folder, which also is in the src folder, but they aren't working after export.
BufferedReader read = new BufferedReader(new FileReader(getClass().getResource("/res/player/" + name + "/data.txt").getFile()));
That's the code with that I tried to read the text files
I didn't find any videos or other information in the internet, how to solve this problem.