I am working on a JavaFX project. There is a 'settings' module that saves the user's input into a txt file and reads it every time the app launches. But I find that I can't read it after I packaged it into .jar file, so I changed the reading func to 'Inputstream':
//File myFile = new File(fileName);
InputStream myFile = FileIO.class.getClassLoader().getResourceAsStream(fileName);
Scanner scanner = new Scanner(myFile);
and I can't write in the txt as well.
I thought I should put the txt outside the .jar file, but then how can I package it to a .exe file?
I am expecting that by some means I can implement my function and get an .exe file