I am making an application where I have to read text-files in order to make my program work. When I run this application in InteliJ it runs perfectly but when I make a .jar file I get a "no such file exception".
Can someone explain me how to access my files inside a .jar file from a class inside the same .jar file?
Can someone also tell me which type of path is more preferable to use (Absolute or relative)?
NOTE: the purpose of the program is to help friends to learn basic words in Arabic. This means that the .jar file will be moved from one computer to the other and it still has to work.
- By the way, is putting everything into a .jar something good or are there better ways to put my project in one executable file?
Image of my directory structure
The code i use is:
Path path = Paths.get("src/Multimedia/Woordenschat/Boek1/Arabisch/Hoofdstuk 1.txt");