After trying some ways to load the file with no success, I remembered I could use FileInputStream
, which worked perfectly.
InputStream is = new FileInputStream("file.txt");
This is another way to read a file into an InputStream
, it reads the file from the currently running folder.