All .txt files are not being read after converting my java program into an executable file

63 Views Asked by At

My java program contains two operations that uses data's stored in two different .txt files. It works completely fine when running using Netbeans but ones I make it into an executable file, the values from text files are not being read. What should do?

1

There are 1 best solutions below

1
On

Maybe the problem are the paths of your .txt files in your code. Try using a absolute path instead of a relative path to ensure that the files can be found by your program, for example put the file in your desktop, then change the file name to /Users/(name)/Desktop/file.txt