I'm pretty new to Java and I'm facing a problem that I can't find a solution for.
I have written a program that reads and writes to a txt file. When I run it in NetBeans it seems to be working fine, but when I try to run the JAR file, it seems as if the program can't access the txt file.
I created the file using the following code :
File data = new File("src/data.txt");
Could the reason why it won't work be in the creation of the file? And if not what could it be?
EDIT:
The text file is being modified as program advances, if I use the inputstream I won't be able to write to or change the txt file, should I change the way on which I'm managing my data? ( txt files) or is there a way for the jar to still have access to the Txt file?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…